Added javadoc, removed warnings