Added an arraylist to store words and the number of times they occur