O(lg(n)) erase with index