updating of hexagon distance function