delete function

added ability to delete loops found