adding code examples (extracted)