Removed unnecessary qr decomposition