Added javadoc style comments; minor code cleanup