implement functions kind and two_pair