downgraded to java 6, added javadoc