begin work on querying the database