Using std::map instead of array