exercise code from textbooks