Added @ javadoc and more comments