Problem 8 working but ugly