ex5 complete and tested