code snippets fixes