Added javadocs for the word counter