finished ch6 programming challenges