odelX;
  var modelS;

  resetModel();

  function resetModel() {
    modelX = Model.random_input();
    modelS = Model.random_state();
    userCoordinates = [];
  }

  function updateModel(dx, dy, penState) {
    modelX.set(0, dx);
    modelX.set(1, dy);
    modelX.set(2, penState);
    modelS = Model.update(modelX, modelS);
  }

  function rollout(steps) {
    var coordinates = [];
    var dx = 0,
        dy = 0;
    var penState = 0;

    var localModelX;
    var localModelZ;
    var localModelS = [
     