reward_history[i].push(smooth_reward[i]);
        }
      }
      if(flott === 50) {
        flott = 0;
      }

      var agent = w.agents[0];
      if(typeof agent.expi !== 'undefined') {
        $("#expi").html(agent.expi);
      }
      if(typeof agent.tderror !== 'undefined') {
        $("#tde").html(agent.tderror.toFixed(3));
      }
    }

    // flot stuff
    var nflot = 1000;
    function initFlot() {
      var container = $("#flotreward");
      var res = getFlotRewards(0);
      var res1 = getFl