Update replication.R