updated querydb w/ better comments