ethan update the generating algorithm of map