add part 4 solution to assignment 3