Please use map in preference to each loops like this.