Detection of diagonals