Added map transformation code