implemented builtin function: Replicate()