Replaced silly macro with range base loop