optimize get_line_score