Sorting heptagons with a linear sieve