ex2 with same test cases as in the first  hand in