-a added ex2 code