improving the code snippets in the last blog entry