query for N, Q, R, X, Y; closes #21 closes #22