changed the code snippets