Optimized STL Code