added populateCharOccurences function and check for equality of character occurences