for second iteration