added ex3 and ex4