Update with the blog entry I got this code from.