fixed errors in iterations limit
changed the way groups are merged for filtering