sync2

cleaned up code and added comments