Simplify exercise 5