updated code examples in doc