Added main_iteration().