code cleanup
javadocs added