make a wordcounter script from scratch