Shouldn't it rather use the poker rules, thus taking the second-highest card?
I know. It was difficult for me to add this mini game. As it's not an important part of the game I haven't spent much time on doing complete poker rules.