added several iteration macros to avoid using loop directly