Initial work on querying.