      script.src  = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
        document.getElementsByTagName("head")[0].appendChild(script);
        jaxrendered = true;
      })();
    }
    
    function updateStats() {
      var stats = "<ul>";
      for(var i=0; i<w.agents.length; i++) {
        stats += "<li>Player " + (i+1) + ": " + w.agents[i].apples + " apples, " + w.agents[i].poison + " poison</li>";
      }
      stats += "</ul>";
      $("#apples_and_poison").html(sta