Initial working draft of the new replicate algorithm using