added some javadoc and deleted some unused lines