tried to create a function for activityDuration max