added Javadoc for functions