finished ex2 and ex1