added exercise 6. solution