added solution for ex2