Modified it to choose a random best option, rather than just take the first it encounters