Starting on sweep and prune

Added endpoint struct, but now arrived at a dilemma as I'm no longer
using a fixed array and so can't count on fixed indexing. What to do.