Code used on the mcfromnz.wordpress blog