pset4 added fn getWordScore