This is my first attempt at a painless script, however almost every example makes use of a \'state\' object which is not available in my version.
i.e.