changed lookup to accept query for desired lookup tables