Use std algorithm functions