fixed code snippets