updated chapter2 sample 3