There is a bug though that confused me a bit. The input has the value 1, but the hardcoded call of the draw function uses 7 on page load. I.e. line 66
draw(7);