remove algorithm