Created delete function and also created tests for them