added more tests and fixed a delete bug