updated most of the queries