solve exercise #9