_.each changed to forEach and for() loops
_.reduce changed to reduce