Franklin County, VA
County
Add Comparison
2021 Population
54,829
2.49% 1-year decline
US Senator
Mark Warner
Democratic Party
US Senator
Tim Kaine
Democratic Party
2021 Median Age
48.1
0.208% 1-year increase
2021 Poverty Rate
13.3%
5.22% 1-year decrease
2021 Median Household Income
$59,667
5.09% 1-year growth
2021 Median Property Value
$181,400
3.89% 1-year growth
2021 Employed Population
23,767
2.7% 1-year decline
About
In 2021, Franklin County, VA had a population of 54.8k people with a median age of 48.1 and a median household income of $59,667. Between 2020 and 2021 the population of Franklin County, VA declined from 56,231 to 54,829, a −2.49% decrease and its median household income grew from $56,779 to $59,667, a 5.09% increase.
The 5 largest ethnic groups in Franklin County, VA are White (Non-Hispanic) (86.9%), Black or African American (Non-Hispanic) (7.69%), Two+ (Non-Hispanic) (1.58%), White (Hispanic) (1.36%), and Two+ (Hispanic) (0.917%).
None of the households in Franklin County, VA reported speaking a non-English language at home as their primary shared language. This does not consider the potential multi-lingual nature of households, but only the primary self-reported language spoken by all members of the household.
98.8% of the residents in Franklin County, VA are U.S. citizens.
The largest universities in Franklin County, VA are Ferrum College (163 degrees awarded in 2021).
In 2021, the median property value in Franklin County, VA was $181,400, and the homeownership rate was 80.4%.
Most people in Franklin County, VA drove alone to work, and the average commute time was 31 minutes. The average car ownership in Franklin County, VA was 2 cars per household.
Franklin County, VA borders Bedford County, VA, Floyd County, VA, Henry County, VA, Patrick County, VA, Pittsylvania County, VA, and Roanoke County, VA.
United StatesVirginiaRoanoke, VA
Franklin County, VA is home to a population of 54.8k people, from which 98.8% are citizens. As of 2021, 2.35% of Franklin County, VA residents were born outside of the country (1.29k people).
In 2021, there were 11.3 times more White (Non-Hispanic) residents (47.7k people) in Franklin County, VA than any other race or ethnicity. There were 4.22k Black or African American (Non-Hispanic) and 868 Two+ (Non-Hispanic) residents, the second and third most common ethnic groups.
Citizenship
98.8%
2021 Citizenship
98.9%
2020 Citizenship
As of 2021, 98.8% of Franklin County, VA residents were US citizens, which is higher than the national average of 93.4%. In 2020, the percentage of US citizens in Franklin County, VA was 98.9%, meaning that the rate of citizenship has been decreasing.
The following chart shows US citizenship percentages in Franklin County, VA compared to that of it's neighboring and parent geographies.
View Data Save Image Share / Embed Add Data to Cart
Diversity
Race and Ethnicity
The 3 largest ethnic groups in Franklin County, VA
White (Non-Hispanic)
47.7k ± 80
Black or African American (Non-Hispanic)
4.22k ± 236
Two+ (Non-Hispanic)
868 ± 276
2.94%
Hispanic Population
1.61k people
In 2021, there were 11.3 times more White (Non-Hispanic) residents (47.7k people) in Franklin County, VA than any other race or ethnicity. There were 4.22k Black or African American (Non-Hispanic) and 868 Two+ (Non-Hispanic) residents, the second and third most common ethnic groups.
2.94% of the people in Franklin County, VA are hispanic (1.61k people).
The following chart shows the 7 races represented in Franklin County, VA as a share of the total population.
View Data Save Image Share / Embed Add Data to Cart
Global Diversity
The PUMS dataset is not available at the County level, so we are showing data for Virginia.
Most Common Origin
El Salvador
109,039 ± 8,055 people
96,011 ± 7,565 people
Mexico
59,097 ± 5,948 people
In 2021, the most common birthplace for the foreign-born residents of Virginia was El Salvador, the natal country of 109,039 Virginia residents, followed by India with 96,011 and Mexico with 59,097.
View Data Save Image Share / Embed Add Data to Cart
Foreign-Born Population
2.35%
2021 Foreign-Born Population
1.29k people
2.12%
2020 Foreign-Born Population
1.19k people
As of 2021, 2.35% of Franklin County, VA residents (1.29k people) were born outside of the United States, which is lower than the national average of 13.6%. In 2020, the percentage of foreign-born citizens in Franklin County, VA was 2.12%, meaning that the rate has been increasing.
The following chart shows the percentage of foreign-born residents in Franklin County, VA compared to that of it's neighboring and parent geographies.
View Data Save Image Share / Embed Add Data to Cart
Veterans
Most Common Service Period
Vietnam
1,290 ± 245
Gulf War (2001-)
600 ± 187
Gulf War (1990s)
483 ± 175
Franklin County, VA has a large population of military personnel who served in Vietnam, 2.15 times greater than any other conflict.
View Data Save Image Share / Embed Add Data to Cart
Economy
The economy of Franklin County, VA employs 23.8k people. The largest industries in Franklin County, VA are Manufacturing (3,175 people), Health Care & Social Assistance (3,138 people), and Retail Trade (2,877 people), and the highest paying industries are Utilities ($74,968), Professional, Scientific, & Technical Services ($71,384), and Transportation & Warehousing, & Utilities ($65,457).
Males in Virginia have an average income that is 1.33 times higher than the average income of females, which is $63,894. The income inequality in Virginia (measured using the Gini index) is 0.476, which is lower than than the national average.
Employment
Occupations
23.8k
2021 Value
± 1,303
−2.7%
1 Year decline
± 7.96%
From 2020 to 2021, employment in Franklin County, VA declined at a rate of −2.7%, from 24.4k employees to 23.8k employees.
The most common job groups, by number of people living in Franklin County, VA, are Management Occupations (2,469 people), Office & Administrative Support Occupations (2,391 people), and Sales & Related Occupations (2,267 people). This chart illustrates the share breakdown of the primary jobs held by residents of Franklin County, VA.
View Data Save Image Share / Embed
Unemployment Insurance Claims
Data is only available at the state level. Showing data for false.
This chart shows weekly unemployment insurance claims in Virginia (not-seasonally adjusted) compared with the four states with the most similar impact.
The most recent data point uses Advance State Claims data, which can be revised in subsequent weeks.
View Full Dashboard
View Data Save Image Share / Embed Add Data to Cart
Industries
Employment by Industries
23.8k
2021 Value
± 1,303
−2.7%
1 Year decline
± 7.96%
From 2020 to 2021, employment in Franklin County, VA declined at a rate of −2.7%, from 24.4k employees to 23.8k employees.
The most common employment sectors for those who live in Franklin County, VA, are Manufacturing (3,175 people), Health Care & Social Assistance (3,138 people), and Retail Trade (2,877 people). This chart shows the share breakdown of the primary industries for residents of Franklin County, VA, though some of these residents may live in Franklin County, VA and work somewhere else. Census data is tagged to a residential address, not a work address.
View Data Save Image Share / Embed
Median Earnings by Industry
$47,731
Median earning men ± $3,785
$29,281
Median earning women ± $4,007
The industries with the best median earnings for men in 2021 are Finance & Insurance, & Real Estate & Rental & Leasing ($76,653), Transportation & Warehousing, & Utilities ($66,646), and Professional, Scientific, & Management, & Administrative & Waste Management Services ($65,301).
The industries with the best median earnings for women in 2021 are Finance & Insurance, & Real Estate & Rental & Leasing ($60,061), Public Administration ($58,618), and Transportation & Warehousing, & Utilities ($39,750).
View Data Save Image Share / Embed Add Data to Cart
Employment by Industry Sector
Data is only available at the state level. Showing data for false.
Y-Axis
2.75%
Year-over-year growth
Employment change between February 2022 and February 2023
As of February 2023, there are 155M people employed in Virginia. This represents a 2.75% increase in employment when compared to February 2022.
The following chart shows monthly employment numbers for each industry sector in Virginia.
View Full Dashboard
View Data Save Image Share / Embed Add Data to Cart
Establishments by Size
The industries with the most establishments
258
Finance & Insurance, and Real Estate, Rental & Leasing
256
Educational Services, Health Care & Social Assistance
256
Professional, Scientific & Management, and Administrative & Waste Management Services
The visualization shows the distribution of establishments by industry and by size according to the number of employees.
View Data Save Image Share / Embed
Payroll by Industry Sector
The industries with the highest total annual payroll
$280k
Manufacturing
$93.7k
Educational Services, Health Care & Social Assistance
$64.6k
Professional, Scientific & Management, and Administrative & Waste Management Services
The chart shows the total annual payroll and the average annual payroll by industry.
View Data Save Image Share / Embed
Domestic Trade
Domestic production and consumption consists of products and services shipped from Virginia to other states, or from other states to Virginia.
Top Domestic Production in Dollars
Mixed freight
$37.7B
Electronics
$29B
Machinery
$23.6B
In 2020, the top outbound Virginia product (by dollars) was Mixed freight with $37.7B, followed by Electronics ($29B) and Machinery ($23.6B).
The following chart shows the share of these products in relation to all outbound Virginia products.
View Data Save Image Share / Embed Add Data to Cart
Domestic Trade Growth
Showing data for Virginia.
$313B
2020 Value in Virginia
$612B
Projected 2050 Value in Virginia
95.3% growth
In 2020, total outbound Virginia trade was $313B. This is expected to increase 95.3% to $612B by 2050.
The following chart shows how the domestic outbound Virginia trade is projected to change in comparison to its neighboring states.
View Data Save Image Share / Embed Add Data to Cart
Interstate Trade
Interstate trade consists of products and services shipped from Virginia to other states, or from other states to Virginia.
Most Common Trade Partners
North Carolina
$26B
Maryland
$18.5B
Pennsylvania
$12.4B
In 2020, the top outbound Virginia domestic partner for goods and services (by dollars) was North Carolina with $26B, followed by Maryland with $18.5B and Pennsylvania and $12.4B.
The following map shows the amount of trade that Virginia shares with each state (excluding itself).
View Data Save Image Share / Embed Add Data to Cart
Civics
In the 2020 presidential election, the popular vote in Franklin County, VA went to Donald J. Trump with 75.4% of the vote. The runner-up was Joseph R Biden Jr. (36.7%), followed by Jo Jorgensen (1.31%).
Mark Warner and Tim Kaine are the senators currently representing the state of Virginia. In the United States, senators are elected to 6-year terms with the terms for individual senators staggered.
Virginia is currently represented by 11 members in the U.S. house, and members of the House of Representives are elected to 2-year terms.
Presidential Elections
Presidential Popular Vote Over Time
2020 Election Results
Donald J. Trump (75.4%)
Republican Party
Joseph R Biden Jr. (36.7%)
Democratic Party
Jo Jorgensen (1.31%)
Libertarian Party
In the 2020 presidential election, the popular vote in Franklin County, VA went to Donald J. Trump with 75.4% of the vote. The runner-up was Joseph R Biden Jr. (36.7%), followed by Jo Jorgensen (1.31%).
The following chart shows the popular vote results in Franklin County, VA for each registered party from 1976 to 2020.
View Data Save Image Share / Embed Add Data to Cart
Senator Elections
US Senators from Virginia
Senatorial voting results are only available at the state level. Showing data for Virginia.
Mark Warner
Senator from Virginia2
Assumed office on January 3, 2009
Tim Kaine
Senator from Virginia1
Assumed office on January 3, 2013
Mark Warner and Tim Kaine are the senators currently representing Virginia.
In the United States, senators are elected to 6-year terms with the terms for individual senators staggered.
The following chart shows elected senators in Virginia over time, excluding special elections, colored by their political party.
View Data Save Image Share / Embed Add Data to Cart
US Representative Elections
US Representatives from Virginia
Virginia is currently represented by 11 members in the U.S. house.
Members of the House of Representives are elected to 2-year terms, and the following chart shows the how the members for Virginia have changed over time starting in 2008.
View Data Save Image Share / Embed Add Data to Cart
View Data Save Image Share / Embed Add Data to Cart
Education
In 2021, universities in Franklin County, VA awarded 163 degrees. The student population of Franklin County, VA in 2021 is skewed towards men, with 513 male students and 356 female students.
Most students graduating from Universities in Franklin County, VA are White (95 and 58.6%), followed by Black or African American (41 and 25.3%), Hispanic or Latino (10 and 6.17%), and Two or More Races (10 and 6.17%).
The largest universities in Franklin County, VA by number of degrees awarded are Ferrum College (163 and 100%).
The most popular majors in Franklin County, VA are (24 and 14.7%), Other Health Preparatory Programs (23 and 14.1%), and Environmental Science (13 and 7.98%).
The median tuition cost in Franklin County, VA for private four year colleges is $36,480.
University
Measure
In 2021 in Franklin County, VA, the percentage of applicants admitted was 76.4%, while the percentage of admitted who enrolled was 17.2%. The number of students enrolled in 2021 was 869 (59% men and 41% women).
The line chart shows the evolution of the percentage of applicants admitted, admitted who enrolled or the number of students enrolled according to the option selected in the upper button.
View Data Save Image Share / Embed Add Data to Cart
Enrollments by Gender and Races
Universities
In 2021 there were 869 students enrolled in Franklin County, VA, 59% men and 41% women.
By race, the largest number of students enrolled was concentrated in White with 432 records, of which 50.2% were women and 49.8% men.
View Data Save Image Share / Embed Add Data to Cart
Completions
Concentrations
Most Common
Other Health Preparatory Programs
23 degree-majors awarded
Environmental Science
13 degree-majors awarded
24 degree-majors awarded
In 2021, the most common concentation for Bachelors Degree recipients in Franklin County, VA was Other Health Preparatory Programs with 23 degrees awarded.
This visualization illustrates the percentage of students graduating with a Bachelors Degree from schools in Franklin County, VA according to their major.
View Data Save Image Share / Embed Add Data to Cart
Universities
Gender
Race
Ferrum College
Largest Universities by degrees awarded
163 degrees awarded
In 2021, the institution with the largest number of graduating students was Ferrum College with 163 degrees awarded.
View Data Save Image Share / Embed Add Data to Cart
Student Diversity
University
In 2021, 80 men were awarded degrees from institutions in Franklin County, VA, which is 0.964 times less than the 83 female students who received degrees in the same year.
In 2021 the most common race/ethnicity group awarded degrees at institutions was White students. These 95 degrees mean that there were 2.32 times more degrees awarded to White students then the next closest race/ethnicity group, Black or African American, with 41 degrees awarded.
View Data Save Image Share / Embed Add Data to Cart
Awarded Degrees over Time
The graph shows the evolution of awarded degrees by degrees. Under the paragraphs, the average number of awarded degrees by university in each degree is shown.
View Data Save Image Share / Embed Add Data to Cart
View Data Save Image Share / Embed Add Data to Cart
Tuition
Average Net Price by Sector
Universities
Private not-for-profit, 4-year or above ($36,480) is the sector with the highest median state tuition in 2021.
Private not-for-profit, 4-year or above ($350) is the sector with the highest median state fee in 2021.
Private not-for-profit, 4-year or above ($800) is the sector with the highest average net price of books and supplies.
The graph shows the average net price by sector and year.
View Data Save Image Share / Embed
Working Population
Educational Pyramid
Data is only available at the state level. Showing data for Virginia.
Measure
In 2021, 0.836% of men over 25 years of age had not completed any academic degree (no schooling), while 0.859% of women were in the same situation.
This visualization shows the gender distribution of the population according to the academic level reached.
View Data Save Image Share / Embed Add Data to Cart
Educational Attainment
Data is only available at the state level. Showing data for Virginia.
Race
The most common educational levels obtained by the working population in 2021 were High School or Equivalent (1.68M), Bachelors Degree (1.44M), and Some college (1.41M).
This visualization illustrates the percentage distribution of the population according to the highest educational level reached. You can filter the data by race by using the selector above.
View Data Save Image Share / Embed Add Data to Cart
The median property value in Franklin County, VA was $181,400 in 2021, which is 0.741 times smaller than the national average of $244,900. Between 2020 and 2021 the median property value increased from $174,600 to $181,400, a 3.89% increase. The homeownership rate in Franklin County, VA is 80.4%, which is approximately the same as the national average of 64.6%.
People in Franklin County, VA have an average commute time of 31 minutes, and they drove alone to work. Car ownership in Franklin County, VA is approximately the same as the national average, with an average of 2 cars per household.
Median household income in Franklin County, VA is $59,667. In 2021, the tract with the highest Median Household Income in Franklin County, VA was Census Tract 201.02 with a value of $87,031, followed by Census Tract 202 and Census Tract 204, with respective values of $67,155 and $62,895.
In 2022, 12.7% of the population was living with severe housing problems in Franklin County, VA. From 2014 to 2022, the indicator grew 0.76%.
Housing
Property
$181,400
Median Property Value 2021
±$10,987
$17,721
Median Property Taxes
±$1,063
The following chart display owner-occupied housing units distributed between a series of property tax buckets compared to the national averages for each bucket. In Franklin County, VA the largest share of households pay taxes in the < $800 range.
The chart underneath the paragraph shows the property taxes in Franklin County, VA compared to it's parent and neighbor geographies.
View Data Save Image Share / Embed Add Data to Cart
View Data Save Image Share / Embed Add Data to Cart
Rent vs Own
80.4%
Homeownership
2021
67.7%
Homeowners with Mortgage
2021
In 2021, 80.4% of the housing units in Franklin County, VA were occupied by their owner. This percentage declined from the previous year's rate of 81.6%.
This chart shows the percentage of owner in Franklin County, VA compared it's parent and neighboring geographies.
View Data Save Image Share / Embed Add Data to Cart
Equity
Income by Location
Use the dropdown to filter by race/ethnicity.
Race/Ethnicity
Highest Median Household Income (Total)
Census Tract 201.02
Census Tract 202
Census Tract 204
In 2021, the tract with the highest Median Household Income (Total) in Franklin County, VA was Census Tract 201.02 with a value of $87,031, followed by Census Tract 202 and Census Tract 204, with respective values of $67,155 and $62,895.
The following map shows all of the tracts in Franklin County, VA colored by their Median Household Income (Total).
View Data Save Image Share / Embed Add Data to Cart
Household Income
Please note that the buckets used in this visualization were not evenly distributed by ACS when publishing the data.
$59,667
Median Household Income
± $3,346
22k
Number of Households
± 1,255
In 2021, the median household income of the 22k households in Franklin County, VA grew to $59,667 from the previous year's value of $56,779.
The following chart displays the households in Franklin County, VA distributed between a series of income buckets compared to the national averages for each bucket. The largest share of households have an income in the $75k - $100k range.
View Data Save Image Share / Embed Add Data to Cart
Wage Distribution
The closest comparable wage GINI for Franklin County, VA is from Virginia.
0.476
2021 Wage GINI in Virginia
0.478
2020 Wage GINI in Virginia
In 2021, the income inequality in Virginia was 0.476 according to the GINI calculation of the wage distribution. Income inequality had a 0.381% decline from 2020 to 2021, which means that wage distribution grew somewhat more even. The GINI for Virginia was lower than than the national average of 0.478. In other words, wages are distributed more evenly in Virginia in comparison to the national average.
This chart shows the number of workers in Virginia across various wage buckets compared to the national average.
View Data Save Image Share / Embed Add Data to Cart
Transportation
Commuter Transportation
Most Common Commute in 2021
Drove Alone (80.6%)
Worked At Home (9.74%)
Carpooled (6.65%)
In 2021, 80.6% of workers in Franklin County, VA drove alone to work, followed by those who worked at home (9.74%) and those who carpooled to work (6.65%).
The following chart shows the number of households using each mode of transportation over time, using a logarithmic scale on the y-axis to help better show variations in the smaller means of commuting.
View Data Save Image Share / Embed Add Data to Cart
Commute Time
31 minutes
Average Travel Time
Using averages, employees in Franklin County, VA have a longer commute time (31 minutes) than the normal US worker (26.8 minutes). Additionally, 2.31% of the workforce in Franklin County, VA have "super commutes" in excess of 90 minutes.
The chart below shows how the median household income in Franklin County, VA compares to that of it's neighboring and parent geographies.
View Data Save Image Share / Embed Add Data to Cart
View Data Save Image Share / Embed Add Data to Cart
Car Ownership
2 cars
Average Number
The following chart displays the households in Franklin County, VA distributed between a series of car ownership buckets compared to the national averages for each bucket. The largest share of households in Franklin County, VA have 2 cars.
View Data Save Image Share / Embed Add Data to Cart
Poverty
Severe Housing Problems
In 2022, 12.7% of the population was living with severe housing problems in Franklin County, VA. From 2014 to 2022, the indicator grew 0.76%.
The graph shows the trend of the percentage of the population living with severe housing problems.
View Data Save Image Share / Embed Add Data to Cart
13.3% of the population for whom poverty status is determined in Franklin County, VA (7.07k out of 53.1k people) live below the poverty line, a number that is higher than the national average of 12.6%. The largest demographic living in poverty are Males 55 - 64, followed by Females 55 - 64 and then Females 35 - 44.
The most common racial or ethnic group living below the poverty line in Franklin County, VA is White, followed by Black and Two Or More.
The Census Bureau uses a set of money income thresholds that vary by family size and composition to determine who classifies as impoverished. If a family's total income is less than the family's threshold than that family and every individual in it is considered to be living in poverty.
View Data Save Image Share / Embed Add Data to Cart
Children in Poverty
In 2022, 17% of the children was living in poverty in Franklin County, VA. From 2014 to 2022, the indicator declined 4%.
The graph shows the trend of the percentage of the children living in poverty.
View Data Save Image Share / Embed Add Data to Cart
Social Needs
Data only available at the state level.
Most prevalent states
California
35,798 individuals
New York
5,087 individuals
Florida
4,915 individuals
In 2017, California had the highest estimated number of chronically homeless individuals in the nation, at 35,798. New York has the second highest (5,087), followed by Florida (4,915).
The following map shows the estimated number of chronically homeless individuals by state over multiple years.
View Data Save Image Share / Embed Add Data to Cart
Security
Indicator
In 2022, the number of reported violent crimes offenses per 100,000 population was 150 in Franklin County, VA. From 2014 to 2022, the indicator grew 44.4 per 100,000 population.
The graph shows the trend in the number of reported violent crimes offenses per 100,000 population.
Error: TypeError: measure_.at is not a function
Health
90.7% of the population of Franklin County, VA has health coverage, with 41.9% on employee plans, 14.3% on Medicaid, 20.9% on Medicare, 10.8% on non-group plans, and 2.87% on military or VA plans.
Primary care physicians in Franklin County, VA see 2547 patients per year on average, which represents a 4.82% decrease from the previous year (2676 patients). Compare this to dentists who see 6241 patients per year, and mental health providers who see 1146 patients per year.
By gender, of the total number of insured persons, 49% were men and 51% were women.
Coverage
Patient to Clinician Ratios
2,547 to 1
Patient to Primary Care Physician Ratio in Franklin County, VA
Primary care physicians in Franklin County, VA see an average of 2,547 patients per year. This represents a 4.82% decrease from the previous year (2,676 patients).
The following chart shows how the number of patients seen by primary care physicians has been changing over time in Franklin County, VA in comparison to its neighboring geographies.
View Data Save Image Share / Embed Add Data to Cart
Health Care Diversity
In 2021, insured persons according to age ranges were distributed in 20.5% under 18 years, 16.5% between 18 and 34 years, 39.6% between 35 and 64 years, and 23.4% over 64 years.
By gender, of the total number of insured persons, 49% were men and 51% were women.
The following chart shows the number of people with health coverage by gender.
View Data Save Image Share / Embed Add Data to Cart
Uninsured People
9.26%
Uninsured
41.9%
Employer Coverage
14.3%
Medicaid
20.9%
Medicare
10.8%
Non-Group
2.87%
Military or VA
Between 2020 and 2021, the percent of uninsured citizens in Franklin County, VA declined by 2.86% from 9.53% to 9.26%.
The following chart shows how the percent of uninsured individuals in Franklin County, VA changed over time compared with the percent of individuals enrolled in various types of health insurance.
View Data Save Image Share / Embed Add Data to Cart
Health Indicators
Health Outcomes
Indicator
In 2022, the number of deaths among residents under age 18 per 100,000 population was 58.7 in Franklin County, VA.
The graphic shows the trend of the indicator in Franklin County, VA.
Error: TypeError: measure_.at is not a function
Health Behaviors
Indicator
In 2022, the percentage of the adult population (age 18 and older) that reports a body mass index (BMI) greater than or equal to 30 kg/m2 (age-adjusted) was 37.6% in Franklin County, VA.
The graphic shows the trend of the indicator in Franklin County, VA.
Error: TypeError: measure_.at is not a function
Clinical Care
Indicator
In 2022, the percentage of population under age 65 without health insurance was 10.3% in Franklin County, VA.
The graphic shows the trend of the indicator in Franklin County, VA.
Error: TypeError: measure_.at is not a function