buildMap function