refactored ex10 further according to brokken's rules