adding Javadocs and update code with checkstyle fix
checkstyle and javadocs added