Problem 3

This program is currently extremely inefficient!