started implementing replication logic

tests pending