Please see the following for the code
http://www.michaelmcgrady.com/