add union function to problem 2 part b