solve exercise #7