modify some algorithm