Comments, code cleaning commit

cleaned up some code, added some comments