Added some comments and created a synchronize method