Implement replication on all array values for for-loop