Added tests for delete and implemented logic.