more Javadocs and formatting