Added Sync logic (first draft)