Created a new function  to get our query data from.

Pulled a query into a new function that returns the query, check to see
if it works.