Separated it into two functions so now it'll be clear if check happens for orthonormal or just orthogonal.