Grid query

- Added basic grid query implementation.