Added an alternate solution to the replicate