solve exercise #8