finally got the delete function working, huzzah