introducing a correctly sorted group tree.