Changed loop type