formatting queries for homework 3