adding some javadoc comments, as well as trying to comment any other code I can to make it easier to understand.