updating code snippets in README file