solve exercise #22