Added building of inheritance map and actual remapping.