Minor changes.
Added a query function.