revise code snippets