this if depends on the element of the loop.
If i will add computation of this isRequired to the loop, i'd say it would be a lot harder to read