Completed Problem 16 (finally)