add code example of chapter1