added concept of ordering on queries