Implemented words counting