added word and char count functions