work in progress.
Changed from createXFromMap to createXMap.