Replaced the delete() function