handle quads and triples