Fixed newline at EOL and added javadoc comments.