added basic query functionality