add part of problem 3