Everybody knows the recipe for optimum health: Eat right and exercise. But that's often easier said than done, especially after you've started slacking and work and family life make it tough to squeeze in workouts and square meals. So once you've decided to give getting healthier a go, you want to do it in a way that'll stick. According to a new study, that means making dietary changes and hitting the treadmill simultaneously, rather than starting one or the other first.

Researchers from Stanford University rounded up 200 adults who were too time-strapped to exercise and ate subpar diets but wanted to lead healthier lives. They divided participants into four groups. The first group was coached on how to start eating better and exercising at the same time, the second group learned how to tweak their diet only and then begin working out a few months later, the third was told just to exercise first and then pick more nutritious foods later, and the final group was instructed to keep things status quo but received stress-management coaching.

After tracking the participants' progress for a year, the researchers found that those who improved their diets and got active at the same time stuck to both plans way better than the other groups. The people who exercised first generally caught on to eating more nutritiously later, but they had a harder time of it than those who did both simultaneously. And the ones who did a diet overhaul first? Although they achieved their eating goals, they struggled to fit exercise into their routines.

According to lead study author Abby King, the diet-first group had a tough time getting active because "by starting with dietary changes, we think they were so focused on the multiple food decisions they had to make throughout the day that it left little motivational energy to tackle physical activity subsequently." Plus, she says people generally already have eating penciled into their day, whereas physical activity must be added to already-busy schedules, and that can be challenging when it hasn't been given equal priority with dietary changes from the get-go.

By contrast, King says that by tackling exercise first, people are at their "freshest" from a motivational perspective and may be better at figuring out ways to manage their time to allow for more physical activity. "In addition, some of the positive feelings we experience from exercise may help in making another health behavior change, such as diet," she says.

There you have it. If you want to eat better and get fit, go all in.