added Adrian's hand_matching