bugfix when the matrix is ordered

End game if the matrix is in correct order