finished ch11 programming challenge 4