added qr factorization to main method