complete ex2 and ex3