Renamed lookup function to query