add q to the output