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