Updated map generator function.