finished basics for problem 2