Added more javadoc comments to the code