Initial sync code