solved exercise 7 from arrays