Problem 8 works