add line_count function