finished all examples from chapter4