Sync implemented

Sync as issue, added unit tests, needs test for broken, to do later