finished the syncing functions

ready for debug round one