Added card_ranks function, used a really cool trick taught by Peter Norvig