using stl algorithms