Changed buildBitmap() to use make_pair and emplace instead of insert