added test code for q learner