Solved problem 3

Not my code, but it was a great exercise in figuring out how to read
code.