implementing functionality for "remove groups with no data" checkbox,
still a few bugs