use groups by the diagrams