Synch logic improved and comments added