Cleaned up the script

This script wasn't a very good example for scripters. Cleaned it up so it's much, much easier to change in future