I put "const std::map<int, int>& lmap" and made it work. I'm trying to finish this up and will try to push the changes in a couple of days.