Replaced macro with for-loop.