add some javadocs and reformat sources