Better algorithm to comput map data