Added word counter funciton. Not yet tested