added more query functionality