Remove function changed (non-working version)