Javadoc applied and added comments

Useless code also being removed.