use stl algorithm