hacked together a try at index replication protocol