Added function to query a data set