updated printing and javadoc