              // record smooth reward
              if(smooth_reward_history.length >= nflot) {
                smooth_reward_history = smooth_reward_history.slice(1);
              }
              smooth_reward_history.push(smooth_reward);
              flott = 0;
            }
          }

          updateDraw(action, state, obs.r);
          if(typeof agent.expi !== 'undefined') {
            $("#expi").html(agent.expi);
          }
          if(typeof agent.tderror !== 'undefined') {
            $("#tde