Whitespace bug fixed. Also added javadoc comments.