fixed some edge cases in delete; now works some of the time; updated test script