Delete function nearly completed