wrote a count words method, slightly changed graph