adds qr factorization with classical/modified Gram-Schmidt