cleaned code up
added more comments
removed unnecessary constants and variables
removed trailing whitespace