Implement erase method.