completed functions to test values of Q