Updated example code in README.md. This fixes issue #570.

The same as PR #585 but for branch 0.3