Removed window.sync, added some comments.