delete Algorithm