replaced one forEach with map