updated exercise 6