Thanks to Chris Courses for the tutorials teaching me how to do this.
(I hope you'll have a laugh about the picture mate :p)
You don't have to give credit or anything for using this code, but if you can, please do let other people know where you found it and post a link to this page - it helps others find it more easily.