Modified setPQR to work for p, q, r and s, as well as to be more robust