generalize queryinput to allow multiple