partial implementation of qlearning agent