Begins solution for problem 3