reduce loops