ex17
ex17 refactored