Homework: detecting pairs of cards