implemented replicateM using fill and sequence.