made sync functional
fixing sync bugs
syncing works somewhat