added q2r plot code