minor changes to mapping code