added comments
added a few more changes