javadoc for algorithm