Tried to fix the delete bug
Added a test program