Made problem 17 slightly less verbose.