Solved problem 10 (poorly).