Added more comments and outlined sync algorithm (which has some shortcommings marked with continuous dots).