complete exercise for ch6