added comments

added comments cleaned up code