changes to Replicated and added a unit test