reformatted the query