finished method to delete a file