Use features.forEach instead of for loop
Use layers.forEach instead of for loop