Implemented word counter