Added comments and Javadocs.