changed max_pos to line_length so it makes more sense