Works, though slowly.
Next attempt, this time at a shared_ptr based map.