loop correctly on the variants array