added ex3 and final ex2