Added comments and Javadocs