replace Add to use emplace.
also greatly simplifies remove as you can just do map.erase(key). This returns the number of elements actually erased, so don't even need to check if it exists, you can just return whether the return value from the erase call ==1.
Also requires changing the use of pointers everywhere to not do that.