made some progress on delete function, but currently segfaulting. ugh