I was 20 pounds overweight. I was tired all the time. I had stinging back pain. Even though I worked out three days a week, a few hours of spotty exercise couldn't undo the other 10 hours a day I spent hunched over at a laptop.

My body was at the breaking point, and so like many of my desk-chained brethren, I dabbled with popular alternatives. They all failed: standing desks smoked my lower back, dieting was a recipe for yo-yo weight loss, and occasional walking breaks ended up as an ironic trip to the office snack room.

I've come to realize most conventional solutions to office-induced poor health are entirely too pessimistic. They all assume that the best we can do is mildly reduce the inevitable self-destruction of our jobs.

I was convinced this pessimism was misguided; desk jobs don't have to make us fatter, sicker, and duller. It's possible to transform nearly any office into a place that leaves us fitter and more energized than when we stumble in with a morning Starbucks. Here's what I did — and what you can do:

How is this article different from all other articles? This is first in a regular Vox series on better living through technology and science. I, your humble guinea pig, will subject myself to all sorts of experiments to discover what practical tips readers can apply to their lives immediately. What makes this series different from traditional health writing is its emphasis on the techniques of "quantified self": the science of self-improvement. No single study can tell you, exactly, how a diet or exercise regimen will impact your particular body. When it comes to health, we're all individual snowflakes. For instance, within a study that finds that low-carb diets help participants lose weight, some may have lost none at all. Quantified self helps us figure out how to apply research to ourselves, by carefully measuring our progress with available consumer tools. All of the techniques in this post worked for me. If they also work for you, it most certainly won't be the exact same amount, but I will show you how to measure it yourself.

1) I replaced lunch and morning coffee with brief exercise

The body and mind share a love of exercise, which is why when I'm feeling sluggish, I perform a brief but strenuous workout to kick my brain back into gear. Research has consistently shown the fitness nuts exhibit brain wave patterns associated with sustained attention; this is precisely why schools are turning to gym class as the treatment to spacey children who would otherwise be drugged with Adderall into attentive submission.

Now, exercise has helped me overcome drowsiness during the two parts of my day when I used to turn to food: in the morning, and at midday.

In the morning: Instead of standing 20 minutes in line with the early morning drones to shell out $4 for a cup of legal stimulants, I discovered that I could get most of the benefits of caffeine with just 30 seconds of exercise.

Right when I wake up (or anytime I feel sleepy), I jumpstart my heart to about 165 beats per minute with 30 seconds of jumping-jack pushups (a "burpee") or mountain climbers. Immediately, I feel a surge of energy that boosts my cognitive state more than caffeine.

To objectively test my intuition, I compared 30 seconds of exercise to 250 mg of caffeine — the equivalent of a cup of drip coffee — on a series of complex reaction time tests, a common metric for cognitive performance.

Compared to caffeine, my reaction times post-exercise were about double (12 percent vs. six percent over a baseline test). My short-term memory got an even bigger boost (26 percent vs. 16 percent). My own experience jibes with a 2012 meta-analysis that found that high-intensity exercise tended to have the largest impact on cognitive function, compared to lower-intensity exercises.

Most importantly, the research found that exercises that add muscle-building resistance training are the most effective overall. Not only am I making my brain sharper, but my abs more chiseled.

30-second breaks are stellar for an early-morning pickup, but they aren't sufficient to get me through my productivity arch nemesis: the post-lunch afternoon lull.

At lunchtime: Afternoon meals are a productivity ball-and-chain. About an hour after a hearty lunch, I'm a work zombie. Nutritional neuroscientists have come to expect this crash: "consumption of lunch has been most often reported to impair mental performance and negatively alter mood state," wrote Tufts University's Caroline R. Mahoney and her research team in a comprehensive review of food's effect on cognitive performance [PDF].

Scientists don't actually know why a meal makes us drowsy; the current theory hypothesizes that the hormonal response to digesting food (blood glucose) also switches off so-called "orexin" neurons meant to keep us awake during the hunting process. In other words, after we feed, our body thinks it has done its job and wants to spend the remaining energy absorbing the nutrient goodness in sleepy peace.

Lunch made me, literally, slower: my reaction times sank, as did my short-term memory performance

So, instead of wasting my lunch period waiting in line for what is essentially a glorified sleeping pill, I do my afternoon workout. Sweaty exercise gets the blood pumping and I feel refreshed enough to crush the second half of the day, all while surrounded by colleagues that would trade their next of kin for a nap.

But, like all scientific research, the results tend to be mixed. Older research on lunch finds that people who regularly eat a big meal don't experience the same crash. So, I conducted a self-experiment measuring my cognitive prowess two hours after either a nice long run on an empty stomach or a super-healthy lunch from the San Francisco Farmer's Market.

My intuition was confirmed. Compared to eating a sizable portion of salad and and salmon, exercise increased my short-term working memory by seven percent and my complex reaction time test by 13 percent . Lunch made me, literally, slower: my reaction times sank by 12 percent, as did my short-term memory performance (11 percent).

For those who can't leave the office for a run, the scientific seven-minute workout is a great body-weight all-round routine that also leaves me refreshed. It combines a series of body-weight exercises in rapid succession and builds many of the same muscles as a typical gym session.

I still eat lunch, but it tends to be very light. I'll munch on a small salad with loads of dense healthy fats (olive oil) — this keeps me filled and primed for work.

How to do these experiments yourself

Essential technology: I find that I get the most bang for my workout buck if I can feel my heart thumping through my chest. For me, that's about 168 beats per minute, or what is known as my anaerobic threshold, the point at which the body consumes more energy than it can reproduce.

Here's how I use the tech: I strap on an exercise-grade heart rate monitor — any device that's not specifically designed for resting heart-rate only. I used a Polar chest strap, but the upcoming Microsoft Health band, which doesn't require a chest strap, is probably a more convenient solution. Then, I perform some high-intensity exercise until I reach my desired beats per minute.

Once I intuit what it takes to feel my heart thumping in various exercises, I no longer need the heart-rate monitor for short bouts of exercise. For longer workouts, like those that replace my lunch, I nearly always use a heart-rate monitor. It's the only thing that keeps me honest about how hard I need to work.

Measuring results: I want exercise to make me sharper, so I record my mental state before and after each experiment.

The simplest way to measure cognitive focus is with a simple reaction time test. HumanBenchmark.com has super-simple 'red light-green light' game on the front page and only takes about 20 seconds to complete.

For more advanced work, I used the website quantified-mind.com, which has every imaginable psychometric test, from complex reaction times to short-term memory. I designed my own six-minute evaluation system, called the "Ferenstein short" test, which is free to the public.

A heart-rate monitor is the only thing that keeps me honest about how hard I need to work

The simplest way to track progress on a self-experiment is with a smartphone. I type in my pre-test scores on a notepad or to-do list, perform an exercise, and then record my post-test scores, noting the time and day. Your notes should have everything you need to measure the percent improvement.

Pre- and post-tests are key to doing self-experimentation with scientific rigor. Each day, I will have generally better or worse focus, depending on how well I sleep, my level of stress, or a million other factors. I do a pre-test right before I exercise and then perform my post-test about an hour after exercise — or at whatever time of day I usually start to nod off. Doing this right after exercise will give you false results, since your heart rate will still be much higher than usual and the test won't tell you how the treatment lingers.

You'll have to play with the timing, too. For me, the effects of high-intensity exercise only last about 90 minutes; the research suggests that it may not be so effective at all for couch potatoes, whose bodies aren't used to intense workouts.

Self-experimentation requires a bit of intuition to understand your own state of mind and then begin systematic measurement after you suspect a pattern emerging.

2) I started stretching during phone calls

I used to just accept chronic joint pain as an unfortunate fact of modern life, like traffic congestion and Hillary Clinton presidential speculation. It never occurred to me that the inability to touch my toes could be the reason for my achy back. I should have known I wasn't alone: research finds that people with tight hamstrings complain of lower back pain more often, because the body strains torso muscles to make up for the inflexibility.

I never bothered to put much time into stretching because I naively ignored how important it was to both my performance during exercise and being less injury-prone throughout the day.

"Flexibility is the third pillar of fitness, next to cardiovascular conditioning and strength training," said David Geier, the director of sports medicine at the Medical University of South Carolina.

Fortunately, there's a delightful opportunity for stretching in the bureaucratic space-time continuum: conference calls. Audio communication provides the perfect blind spot to perform all the awkward contortions of a mobility routine without interrupting the conversation.

Stretching is intellectually effortless; it occupies the body and leaves the mind free to chime in with an occasional "Uh huh, good idea, Ted. I'll circle back after this call."

For the pros — myofascial release: Some light passive stretching is always a nice way relieve a sore back or add injury-resistant slack to tight muscles. But, the traditional type stretching, known as passive stretching, never seemed to increase my range of motion much. I just used to believe that I wasn't capable of much flexibility.

Then I learned about a more advanced strategy that would radically improve my range of motion and decrease pain: myofascial release, self-administered deep-tissue massage.

Myofascial release ("rolling out") is a common physical therapy technique, which has ballooned into a cottage industry of foam rollers for at-home use. Myofascial release is the equivalent of paying a professional bodyworker to dig their thumb through tightened muscles.

Instead of paying a professional once a week, I strategically roll on a lacrosse ball or spikey foam roller for about 15 minutes a day. I find that myofascial release is the prerequisite to for stretching to be effective, otherwise I can stretch all I want and I don't see much improvement.

A fair bit of warning: myofascial release can hurt. For beginners, it's difficult to distinguish between the productive pain of breaking up scar tissue and the destructive pain of wrongly grinding a ball into your joints. I started myofascial release after a thorough consultation with a professional.

But now I look forward phone calls. Whether it's poor posture, sore feet, or achy shoulders, I use this time to get more limber than Gumby at a circus academy.

How to do these experiments yourself

Essential technology: MobilityWOD is my go-to encyclopedia for stretching and mobility. Depending on what ails you, a medical professional will let you know where you need to work. It's important to keep in mind that the site of pain is not always the source. For me, inflexible legs and hips were destroying my lower back. So, now I work through all of MobilityWODs videos on how to loosen up my legs. Here's an example of one of Kelly Starrett's colorful mobility videos:

His (somewhat technical) video can be boiled down to a few points: anyone can do mobility work/myofascial release on their own. If a site is painful to pressure from a roller or ball, it's a good sign that it's a part of the body that's causing pain and stiffness. Roll on a site for at least two minutes, then check to see if things feel better and if range of motion has increased.

The basic gear you need to do these exercises is pretty inexpensive. I don't mind the pain, so I roll out my muscles with a standard lacrosse ball ($3 on Amazon) and the Rumble Roller ($40). I find rolling on on a tennis ball is less painful, but the progress is slower. There's an entire cottage industry of at-home physical therapy tools, which a professional can advise.

Measuring results: Measuring is the easiest for flexibility, but there's nothing universal. I expect immediate results from myofascial release. If I intend to smash my calves so that I can bend over farther, I pre-test my range of motion by seeing how much farther I can reach beyond my toes. Then, I smash my muscles for the medically advisable amount of time and see if I can reach farther. If I make no progress, I look for another solution or another site that could be the culprit behind my pain and stiffness.

Each of MobilityWOD's videos will give advice on the amount of time and ways to test for improvement on the different muscle sites.

3) I ditched my sitting and standing standing desks for a treadmill

It's pretty much accepted dogma among health professionals that any prolonged posture is a killer for both body and mind. Sitting is associated with fatigue, joint pain, and early death. The current trend sweeping the health community is the standing desk, but there's little evidence they are much better.

Standing desks are a "creative idea, but it's not been scientifically proven," Pennington Biomedical Research Professor, Marc Hamilton, told ABC News. "As of now, there's really no research to show they do any good."

I found standing desks just replaced upper back pain with lower back pain — and my legs were constantly tired. Standing desks also have all nasty side effects of standing retail jobs, such as varicose veins and knee pain.

So, to keep my body moving, I transitioned to a walking desk, a flatbed treadmill attached underneath a standing desk. Walking at an average pace of 1.0 mph, I burned 3.5 calories per minute, compared to 1.2 calories per minute standing, and 1 calorie per minute sitting. Over the course of a morning, I'll burn more than 650 calories, or the equivalent of my entire lunch.

In total, on days when I sit (or travel), I burn roughly 2,400 calories per day, compared to 3,500 when I walk at my desk.

My desk has become the place where I burn the most calories, where I exercise to keep my mind refreshed

Is it hard to walk and think at the same time? No more than walking and talking. In fact, the two studies to test the cognitive impact of treadmill desks find that they increase productivity. Compared to sitting, doctors who walked at 1MPH were significantly more accurate at diagnosing CAT scan images (89 percent vs. 99 percent accuracy).

A second study found that when a treadmill desk was introduced into an office, those who regularly walked while working enjoyed 10 percent higher employer satisfaction ratings.

I initially doubted these results until I began using a treadmill regularly. At first, walking and working was difficult: I could muster only 90 minutes a day. Now, after a year, it's the reverse: I sit only 90 minutes a day.

An important step I had to take to make this happen: I threw out all my chairs. In academic studies, workplaces that introduce walking desks see about 75 minutes per day of use per employee. That's the calorie equivalent of half a bagel.

However, physiologically speaking, humans were not meant to sit much at all. The nasty office temptress that prevented me from walking as much as my mailman was the humble office chair. A brief rest from walking would turn into 2 hours of hunchback lounging.

So, I purged my office of all chairs. Tossed. Every. Single. Chair.

I replaced them with the Japanese Zafu , a two-foot diameter bean bag raised 10 inches off the the ground with no back. Zafus are designed to naturally orient the body into a pristine, upright meditation pose, since leaning back on a raised surface is as uncomfortable as biking on a bumpy road wearing a thong.

With a Zafu, there's no temptation to drift off into the productivity black hole of a slouched position watching YouTube. No I office I have will ever have any chair ever again.

How to do these experiments yourself

Essential technology: When I'm on the road, I obviously can't fold up a treadmill desk into luggage. So, I travel with a laptop harness, the Connect-A-Desk. It's an imperfect, awkward solution that allows me to walk around while working at the same time. I'm often too embarrassed to bring the connect-a-desk outside, but I find it's great for walking around a hotel room.

It also helps to keep a pedometer; when I first started walking out, I walked three to six miles a day, and a pedometer keeps me honest about how much I'm actually moving around. There are only two popular pedometers on the market that can track steps while at a walking desk: the Misfit flash and the Fitbit One.

Wrist-worn activity trackers, like the Jawbone and Fitbit Flex, can't recognize steps while my hands are typing on a keyboard. The Misfit is my favorite because it doesn't need charging, has pretty smartphone integration, and can recognize other types of exercise, should I do them throughout the day. It's also half the cost of the Fitbit.

For sitting, a Zafu runs about $40 on Amazon. I also like the BackJoy floor chair, which swivels to orient the pelvis into an upright position. I don't like stability balls for chairs. The research on their benefits is mixed and its still a chair — and chairs are evil.

Measuring results: The goal here is just to maximize movement. I measure it two different ways.

First, sitting for any extended amount of time for any reason can cause muscle stiffness. The Basis watch has a feature that allows me to track sitting for a specified amount of time. My daily target is 30 minutes. I try to minimize the number of times per day I sit longer than 30 minutes, and Basis will reward me if I haven't sat longer than that amount of time.

Second, my goal for steps and calories burned is simply the maximum I can tolerate. On a monthly basis, I try to exceed my previous goals. Over the last year, I've worked my way up to a comfortable 10 to 12 miles per day, so 10 miles is my current goal with my Misfit app. If my feet hurt or legs hurt the next day, I scale back. And, If I'm trying to lose fat, I'll move my goal up to my upper limit until I get to my desired body fat percentage.

For the pros: crank up the MPH, walk a half-marathon, and get some vaseline: To fight off afternoon drowsiness and fuel the fat burning, I crank up my treadmill to speeds somewhere between two and 3.5 miles per hour. That's about the speed at which movie super villains move through crowds when they don't want to break into a conspicuous run. At an average of 2.5 miles per hour, four hours a day. That's an extra six miles a day.

My record so far is a near full marathon: 18.5 miles walked in a single day, with zero loss in productivity. Now, I typically walk between 10 and 14 miles per day. In addition to great cardio, I burn an extra 1,000 to 2,000 calories a day.

Essential technology: The cognitive benefits are wonderful and it's great to shed fat while working, but there are a few downsides. One, I need running shoes. At more than 2.0 mph, fancy work shoes won't cut it and neither will bare feet.

Additionally, since I'm essentially walking a half-marathon, I have to prep my body for one — that means lubricant or long sports underwear. Without a generous amount of vaseline on my inner thighs. I develop chaff sores the size of genetically enhanced strawberries.

Finally, walking several miles a day can do a number on your feet. If I don't walk correctly, I'm in pain for the next few days. The upcoming Sensoria smart sock can sense how feet strike the ground. I tend to pigeon-toe when I walk, and Sensoria has a built-in robotic coach to let me know when my form is failing.

4)I started going outside to answer email

The body is a nutritional sponge; the mouth is just one sensory organ designed to convert nature into fuel for the body. But, as a desk-chained worker, my body was losing out on one of nature's most powerful ingredients: sunlight.

Skin soaks up ultraviolet light (UVB) and converts it to Vitamin D, an essential nutrient in bone health and for absorbing other nutrients. The CDC estimates that roughly three percent of whites and 30 percent of African Americans are deficient in this essential vitamin. As someone who got little to no sunlight, I wasn't surprised when my WellnessFX blood panel alerted me that I was one of the millions Americans with a D deficiency.

I could take vitamin pills, but a recent panel of respected doctors has issued a stern warning against most popular supplements, so I didn't want a solution to potentially cause a much more dangerous problem.

Then I discovered a ready-made solution to boost my nutrition levels, increase my productivity, and boost cognitive function: sending emails while walking outside.

Just in terms of productivity, emailing on my smartphone forces me to be super efficient. Emails are necessarily kept short and I've learned that I (very) rarely ever need to send a long email. Even better, it's damn near impossible to multi-task on a phone, so there's no temptation to drift off to viral-video land in between messages. The limited functionality of a phone keeps me delightfully on task.

Emailing on my smartphone forces me to be super efficient. Emails are necessarily kept short.

Even better, the signature orange tint of natural light triggers the brain to focus. Orange light is like a natural clock that tells the body it shouldn't prepare for rest. In controlled studies, subjects exposed to artificial orange light boosts performed better on a memory test compared to a control group.

"Light therapy is great but can be replaced/complemented by outside exposures if it's relatively bright, i.e. not gray and dull (and wet)," the studies co-author, Giles Vandewalle, wrote to me in an email.

So, to test the effects, I took a stroll outside during San Francisco's blazing heat wave to see how sun affected my brain after a reading task in the afternoon, when I normally start nodding off.

On simple reaction-time test, a solid measure of drowsiness, I experienced no dip in performance compared to a slight decrease (4 percent) when I walked on a treadmill indoors. Four percent may not sound like a lot, but I experience a 14-percent dip on the same test when I'm extremely tired. So, at least for my short test, getting some sunlight was important for keeping me alert.

How to do these experiments yourself

Essential tech: My absolute favorite smartphone mail application is Mailbox. It's gotten rave reviews from just about every tech outlet for its swiping-centric interface, which allows users to quickly archive and set unanswered emails to return to the inbox. With MailBox, I burn through emails.

Measuring results: The goal here is cognitive enhancement, so either HumanBenchmark.com or quantified-mind.com will work. As with the previous instructions on these sites, I write down my pre- and post-test results in my smartphone, with date and time recorded, so that I can detect the percent difference compared to a baseline.

Now, when I want to drop weight on a new diet, I prefer to be at my desk; it's become the place where I burn the most calories. It's also where I stretch to reduce pain and exercise to keep my mind refreshed all day long.

For most decisions in life, we must make hard choices between difficult trade-offs. But, when it comes to transforming our offices into an oasis of super-fitness, it's pretty much all win-win.

I feel better when I'm walking instead of sitting. I enjoy the feeling of stretching during calls and the rush of energy I feel after 30 seconds of exercise. It's natural for our bodies to move all day. The only thing that has been holding our offices back is pessimism — a pessimism that puts us on a spiraling path toward fatigue, depression, and pain.