Implementation of delete operation.