Miraculous things happen in space, roughly 220 miles above the Earth, where the International Space Station (ISS) speeds across the sky at about five miles per second.

Here, where the ISS’s constant free fall over the planet’s horizon simulates the conditions of microgravity, you can twirl weightlessly, launch a 500-pound object with a small flick of a finger, and fly across the room, arm outstretched, like Superman in full save mode. In fact, visit Mission Control at NASA’s Johnson Space Center in Houston, with its theater-size video screen showing live what’s happening in space, and you’ll sometimes see firsthand an astronaut doing exactly that.

But terrible things also happen to your body there—some catastrophic, some even irreversible. Spending just weeks floating out of the reach of gravity is equivalent to being in a lengthy hospital bed rest: Your blood volume drops, which means the heart has less blood to pump and begins to atrophy. With that go your stamina (from VO2 loss), your aerobic and anaerobic fitness, and your strength. Some of the bodily fluids in your lower extremities shift to your head, swelling your face and causing bruising headaches. One of those liquids, spinal fluid, flattens the back of your eyeballs and inflames your optic nerve, which may cause blurry vision and could even cause farsightedness, new research shows—in fact, almost two-thirds of astronauts who’ve spent months at the ISS have reported problems with their eyes. You also run a heightened risk of kidney stones.

As if that’s not devastating enough, in a reduced-gravity environment, your bones lose minerals and begin decreasing in density at a rate of more than 1% per month. (By comparison, elderly men and women on Earth lose density at 1% to 1.5% a year.) This makes the bones weak and brittle and puts you at greater risk of osteoporosis-related fractures later in life. Oh, and your muscles, including those in your spine, wither rapidly.

Few know this better than astronaut Robert “Shane” Kimbrough. As you’re reading this, it’s likely that Kimbrough is on his way or just back to Earth from the International Space Station, where since October 2016 he commanded Expedition 50, whose stated mission was, in part, to study the effects of microgravity on the body’s ability to heal and to research “how lighting can change the overall health and wellbeing of crew members.”

Once the Soyuz Descent module has parachuted onto the steppe of Kazakhstan in central Asia, Kimbrough will return to NASA’s Johnson Space Center, where researchers will subject him to months, even years, of testing, evaluation, and rehabilitation to gauge the long-term effects of living in microgravity.

What kind of extreme training does it take to endure, much less thrive, in space for months—and possibly years—on end? More important, what kind of man?

Except by express invitation, only astronauts and support staff can enter Building 26 at the Johnson Space Center in Houston.

Hidden inside this nondescript, buff-colored cinder block structure on the northeast side of NASA’s 160-acre campus is a high-tech, state-of-the-art fitness center where America’s 44 current astronauts train for their missions into space. Half the length of a football field, the gleaming, airy gym is as spotless as a showroom floor, with row upon row of resistive machines, stationary bicycles, free weights, treadmills, and elliptical trainers, as well as a half-court basketball floor and a 25-yard, two-lane lap pool—everything a fitness junkie could desire.

On this warm May morning in 2016, several months in advance of his autumn space shot, Shane Kimbrough, an energetic, military-fit, 49-year-old retired U.S. Army colonel, is grinding his way through a cardio-and-weightlifting regimen designed to place as much stress on his body as possible and hammer his skeleton and musculature into near-superfit form. Kimbrough has been performing the routine for almost two years in preparation for his upcoming flight mission; in that time, he’s done enough running, lifting, and squatting to satisfy the most demanding of professional trainers—not surprising, since Mark Guilliams, who worked with the Houston Astros, is now NASA’s lead specialist on astronaut strength, conditioning, and rehabilitation.

At this moment, Kimbrough, dressed in gray and black workout clothes, is standing astride a futuristic-looking “universal gym,” a piston-pulley-and-bar contraption called ARED (short for Advanced Resistive Exercise Device). He steps into its steel platform, slips beneath a weight bar attached to a pulley, spreads his feet shoulder-width apart, and does a set of squats. He sets down the weight, spreads his feet as wide as he can manage, into a sumo squat—one of the most demanding, full-body-blasting moves a human can do—then resumes lifting.

He follows this with a third set of squats, this time standing on one foot. Then another set, balanced on the other, to work the hip-adductor muscles. He sets the weight down, changes the load, and does a set of punishing shoulder presses. And on and on until sweat is dripping off him, his workout gear soaked through.

It’s all part of the targeted, intensely rigorous regimen that NASA’s physical training staff has devised in hopes of keeping the bodies of astronauts like Kimbrough from essentially deteriorating while being subjected to the harsh realities of space travel.

Which is why, the day we meet him, Kimbrough is here sweating through yet another training session, readying his body for Expedition 50.

Though, in truth, he’s been preparing to go into space his entire life.

From a very young age, Shane Kimbrough wanted to be an astronaut.

His grandparents, who lived in Florida, would take him to the nearby Kennedy Space Center to watch the Apollo astronauts blast off. Neil Armstrong and Buzz Aldrin were his first heroes. For college he chose West Point—“for the challenge,” the same reason he yearned to fly Apache helicopters.

Eventually he served as a platoon leader in Operation Desert Storm in Iraq and was put in charge of six Apaches. He and his group flew nightly missions deep behind enemy lines, videoing the terrain that U.S. ground troops would cross when they eventually attacked. It was perilous work. “I’ve always been one of those guys—I just want to do what people think I can’t do,” Kimbrough says. “If somebody says I can’t, I’m going to do it.”

When he returned home, his flying experience got him a job training astronauts to land the space shuttle. Three years later, in 2004, NASA chose him for its astronaut corps, where he began working with trainer Guilliams, who saw Kimbrough—a star pitcher during his years at West Point—as a good athlete of average size who needed to get stronger if he wanted to actually fly missions. “He came from a military background and hadn’t done a lot of weight training,” Guilliams says. “We taught him the squat, the deadlift.”

Why those lifts? “It’s a question of gravity,” he explains. When gravity is virtually absent, as it is in space, demands on the body change, as do the body’s responses. Watch any video of an astronaut maneuvering about the space station and you’ll see that he or she is like a monkey swinging through trees—all shoulders and arms. “With any muscle, if you don’t use it, the body just says, ‘OK, I don’t need it,’ ” Guilliams says. “It’s the same thing with bone. If there’s no stimulus on the bone from standing or walking around all day, the body says, ‘Well, I don’t need bone,’ and it starts withering away.”

I've always been one of those guys—I just want to do what people think I can't do.

Countering the risk of bone loss means emphasizing load-bearing exercises. “Most of the bone loss we see is in the lower back, the femoral neck, and the greater trochanter, which is in the hip,” Guilliams says. “So we focus on hip-dominant exercises—squats and deadlifting. Those are the main exercises we build the whole program around. They’re also multijoint, multiplanar movements. We wanted to move his joints in as many different planes as we could, so we threw him everything just in case, so he’d be prepared. Maybe Soyuz lands five hours away from where Mission Control thought you were going to land, and you have to get out of the capsule, and it’s 30 below zero. You have to be ready for anything. An astronaut doesn’t have to be a great athlete, but he has to be fit overall. You’re better off being good at many things than really good at one.”

The big lifts are also important for astronauts not just while they’re in space, but once they return home. For some, it takes months, even years to restore their bone mass. For others, it never fully returns. Kimbrough never wanted that to happen to him.

In 2007, Kimbrough was assigned to his first mission, STS-126, slated to deliver equipment and supplies to the International Space Station in 2008. As is the case with every astronaut, at that point his training regimen became targeted—meaning, Guilliams and his team designed a fitness program specifically for his body type and needs. Because the reality is, just as you need to top off your gas tank before you start a road trip, you need to be jacked before you start a space flight—your bone strength and musculature demand it.

“Mentally, being a guy who works out a lot, it just gave me some peace of mind,” Kimbrough says of the workouts he did to prepare preflight. Yet, even though the 16 days he spent in space weren’t enough to cause him noticeable bone loss, he did lose muscle strength that took him several months of dedicated gym time to recover.

If that kind of damage can be done in just 2½ weeks, imagine the pummeling a body will take in expeditions that are more than five months long.

Fortunately, since 2006, NASA has gotten better at not only training astronauts until they’ve reached a level of superfitness preflight, but also helping them maintain their muscle and bone strength while they’re on the space station itself, via regular, hyper-specific exercise regimens using high-tech equipment that allows for complete, efficient workouts.

Astronauts use three primary machines for the bulk of the workouts they do while living on the ISS: One is the ARED, the sci-fi-looking weightlifting contraption Kimbrough is pumping away at the day we meet him. The others—one a treadmill, the other a stationary bicycle— are also installed in both the NASA gym and the space station, so astronauts can get accustomed to them before they rocket into space.

At the NASA gym, the bike, a Cycle Ergometer with Vibration Isolation and Stabilization System—or CEVIS—is stationary. In orbit, CEVIS is little more than a box bolted to the floor with pedals protruding from each side, with a seat and handlebars. Thanks to microgravity, the version on the space station doesn’t have a seat or handlebars—instead, crew members just wear a pair of bicycle shoes, clip into the pedals, and pedal away, as if riding a unicycle.

The exercise surface of the treadmill—the Combined Operational Load-Bearing External Resistance Treadmill, or COLBERT, for the talk-show host, a huge NASA fan—consists of a series of hard rubber, tank-like slats, rather than the bouncy belt loop you’d run on at a fitness club.

According to Bob Tweedy, who trains crews on the use, maintenance, and repair of the three exercise machines, most astronauts prefer the ARED in space, because so many of them are into lifting.

The COLBERT treadmill is the easiest device to operate but also the most boring. (Unless you’re a runner. In April 2016, while aboard the space station, British astronaut Tim Peake “competed” in the London Marathon in real time.)

For many, the CEVIS bike is the most difficult device to adapt to. “It’s hard to ride a bike in space,” Tweedy says. “You’re unstable, and you don’t have gravity. You’re not holding on to handlebars, and you don’t have any leverage to push the pedals down. You’re using the muscles of one leg to push that pedal down, and the muscles of the other leg to pull that pedal up. It’s a push-pull action, not push-push, like it is on Earth.”

Needless to say, though astronauts may grumble about the machines, they don’t skip their daily workouts. They know the risks if they do.

NASA’s detailed plan for Kimbrough during his space station stay: lifting 45 minutes to an hour at least six days a week, as well as adhering to a strict regimen of exercises designed by Guilliams and his team to minimize muscle atrophy and thinning bones. They reconfigured his routine every week or two to emphasize exercises that strengthen the body parts (hips, pelvis, lower back, legs, heels) most at risk for bone-mass loss and swapped out exercises in each routine every three days or so, mainly to avoid boredom. They changed reps and loads daily. Finally, they assigned him 45 to 60 minutes of cardio work on the bike and treadmill to increase the stamina needed to do tasks such as making repairs outside the space station.

“The biggest thing, physically, that we did in 2008 was spacewalking,” Kimbrough says. “It’s really challenging to move this mass—the big, white space suits we have that weigh about 300 pounds. Being able to control one takes strength and technique. Every time we open and close our hands we’re fighting the pressure of the space suit, so they get worn out. We really do everything with our hands during a space walk and very little with our feet.”

One big hole in NASA’s “space fit” plan for the future: Unfortunately, it’s still designing and testing exercise equipment compact enough to fit in a spaceship that will eventually carry astronauts to Mars—estimated to take place around 2030.

For example, at NASA’s Glenn Research Center in Cleveland, project manager Gail Perusek and her Human Research Program team are developing compact devices that are a fraction of ARED’s mass and volume, while improving on performance and making them capable of supporting both short and long missions. The larger of them will be about a tenth of ARED’s size and suitable for a Mars mission. The smaller will be slightly larger than a shoebox, and support missions will be up to 21 days. “Basically, big enough to stand on for a wide squat, with good form,” Perusek explains.

Crew members would be able to accessorize the new machines, or subtracting parts for different exercises, kind of like a detachable Swiss Army knife. Its functionality as a universal gym would remain; it would also include a rowing-machine element that would replace, aerobically, the stationary bike and treadmill. The plan, according to Perusek, is to develop an International Space Station version and transport it there in 2020 for testing.

Unfortunately, physical decline isn’t the only hazard of life in microgravity.

Even if perfect exercise equipment is invented and optimized for the space station and longer missions, unsolved and unavoidable hazards remain. On the space station you’re exposed to 10 times more radiation than on Earth. And the farther out you venture, the worse the threat from “treacherous” (NASA’s word) galactic cosmic rays, which can increase your cancer risk, damage your central nervous system, and cause heart disease. Case in point: Apollo astronauts who went to the moon—the only humans who’ve flown past the Earth’s protective magnetic shield—died of cardiovascular disease at a significantly higher rate than astronauts who flew only low-Earth orbit or never flew at all, a recent study found. Other new research suggests that the radiation on a planet as far away as Mars could even cause brain damage and cognitive impairment similar to dementia.

Not surprisingly, it’s this radiation that could eventually turn out to be the deal breaker—though we wouldn’t bet against NASA finding a solution for even that. For the time being, it works to continually improve anti-radiation shielding in the space station, monitor crew members’ levels to keep them in the best-shielded locations, and put them on a diet rich in antioxidants to further reduce radiation risks.

Kimbrough, who plans to remain in the astronaut program following his mission, is focused on the things he can control now and in the near future. He’s an evangelist for NASA’s fitness research findings. “All the data we get from all these people who’ve flown have shown we need to do this full-body workout. You don’t need to have this giant chest and nothing else. You don’t need to have giant legs and nothing else. You need to be well-rounded.”

Guilliams concurs. “There’s a ton of science to this,” he says. “A lot of what we’re doing is trying to figure out the best way to train in flight, so when astronauts do get to Mars, they can continue to do their job. That will be part of Shane’s mission. We hope to learn a lot from what he experiences.”