Nearly working need to fix removing algorithm