Added q_value function to get_value