ex2 complete and tested