Creating an activity function