Re-implemented iteration 1 with a macro.