code examples from the GOOS book