vert(d3.event.x) - xScale.invert(x);
    var dy = yScale.invert(d3.event.y) - yScale.invert(y);
    if (x === 0 && y === 0) {
      dx = 0;
      dy = 0;
    }
    userCoordinates.push([dx, dy, penState]);
    renderCoordinates(userCoordinates, inputCanvas);

  }
  function draw() {
    x = d3.event.x;
    y = d3.event.y;
    inputContext.beginPath();
    inputContext.moveTo(x - d3.event.dx, y - d3.event.dy)
    inputContext.lineTo(x, y);
    inputContext.stroke();
    inputContext.strokeRect(x - d3.event.d