replaced manhattan with A* distance