added rq decomposition function from Overton