ex6 completed with extra credit