polishing algorithm1