Sort cells before sending to front end, pass depth around, prune past depth 3