finish exercise 1 and 2 of lab3
addd examples codes from slide of chapter3