I don't understand why this is broken into two scripts.  In particular the rendered version in the output doc page doesn't include the initial lines to define `x` and `y`, so the as-viewed script doesn't actually work.