add Ex1-4 from chapter2