updated code examples