added some javadoc
various style changes