Added the main loop that calculates the probabilities and feeds them in a new dictionary