FInal fixes + priting the query results.