Creating the activity function