first attempt at OO ex9 and beginning of ex10