implementing groups of three and random pairing