Just watch, and change the variable"mode" to see what happened.
I decided to change the pattern up a bit. Thanks to @scratchinghead for the original project.