made ex2.cxx nicer