Delete Algorithm