fix the wrong code fragment in the sample

Hi, I found the wrong code fragment in the README.md. On top of that I think we should unify the code style.