Fixes #6 - updates example code to be Python 3 compatible.