group quries. easier to read now