Add sample code of chapter3