use forEach instead of for-in