Added comments and javadocs