fixing code snippets