Added Remove function and cleaned code