Added some ordering to queries