we run this loop after the entire 'if - else' instead of in both clauses if we set the classes array in the if condition.