changed the formula from using getQvalue of nextstate to computeValueFromQVal, better abstraction and no bug on calling on a terminal state