My edited exercise 6