final code minus javadoc comments