added javadoc and fixed formatting issues
merged from master
Merge pull request #5 from paliwalashish/master

Added Javadoc and fixed formatting issues