fixed javadoc and prettified code