commit homework from chapter 1.2 to 1.4