adding line_count function