Changed loop in step 4