removed debug code and added some more javadoc