fixed crucial mistake in isValidGroup, added znzx and subgroups