595 patterns

That didn't work either.

If you know why your current code failed, you would know why making those variable global didn't fix it.

The fix involves inserting one word in to your current code.