loop formula modified