added 'Query' class, and more