edited exercise 14 from arrays