complete the program ex2