Updated code snippets