Updated to match rules more acurately and account for ties