tidy up problem 5