adding detailed javadoc