Working on exercise 6