assignment 6 for programming 3