Added Javadoc. Fixed whitespaces