Early verion of task 1, chapter 7