Query now supports sorting