my value iteration implementation restored