= null;
    var flott = 0;
    function togglelearn() { 
      if(sid === -1) {
        sid = setInterval(function() {

          for(var k=0;k<steps_per_tick;k++) {
            state = env.getState();
            action = agent.act(state);
            var obs = env.sampleNextState(action);
            agent.learn(obs.r);
            if(smooth_reward == null) { smooth_reward = obs.r; }
            smooth_reward = smooth_reward * 0.999 + obs.r * 0.001;
            flott += 1;
            if(flott === 200) {
