Added basic querying functionality