setting with 2 loops