modified some of the queries