-added most of javadoc