change guard condition to use "for" instead of "If"