Change for loops to .forEach(function(){})   .