New sync logic (untested)