Added comments and javadocs to the various classes and methods.