clean up comments and small bug fix