nState]);
    renderCoordinates(userCoordinates, inputCanvas);
    penState = 1;
    updateModel(userCoordinates);

  }

  inputCanvas.call(drag);

  // we should draw this.

  function redraw() {
    var coordinates = rollout(400);
    renderCoordinates(coordinates, outputContext);
  }

  //
  // Draw
  //

  function renderCoordinates(coordinates, context) {
    context.globalAlpha = 0.9;
    context.fillStyle = "white";
    context.fillRect(0, 0, canvasWidth, canvasHeight);
    context.globalAlpha = 1.0;