finish exercise plan generation function