Added heuristic for diagonals.