fixed errorneous code snippets