add the query function
change names