chapter 13: working and nice code=)