Adds querying functionality.