Issue #8

Here's the patch as requested.