Adding code used in recent blog post.