Problem 6 complied