Update - Final

The code used at PiWars in its final form.
I will be writing some improved code later on, but this will not be
changing.