Removed unused code.
Added Javadoc.