use map + join instead of each