Having compared my solutions with other solutions on the web, there is an easier way to do this.