Added method to count words