Revert A change. Add check to see if UTU is invertible, use pseudo-inverse if not