added JAVADOC and comments