adding javadoc and test coverage