improved nearest_line_item