Very basic demonstration, that could benefit from less magic numbers, inline commenting, and some variable renaming.