Made deleting functionality better