Implemented ordering on queries
Removed logging