solved ex. 5