use for loops instead of forEach; better perf