Added Javadoc comments to code