Implement stl sort