This contains the code from beberiel's blog post.