Added more query functionality.