added mapRegion code and a test case