added comments and javadoc headers