Was doing quite a lot of unnecessary steps. Now construct the sorted verts, edges /w error checking, in a single loop.