working remove function