added query helpers, and tests for helpers