cleaned up methods and javadoc