removed length_so_far