smooth the algorithm section