Implementation of two-stage sindex deletion. Compiles, but still a little incomplete.