Refined exercise 10