solve exercise #4