Added code examples from textbook