ex2 and ex3 done