renamed variables to be more descriptive, made the choice of equal winners random instead of first-in-list