Added some comments and showed several different ways to accomplish synchronization.