Add dict / word as parameters to updateScore function so it does not need to be created in each loop, and shorten it a bit.