Adding code I wrote awhile back for the site.