TARKIO, Mo(CNN) -- Luke Cox used to be an athlete. But a year ago, no one would have called him that.
The 31-year-old high school social studies teacher and coach weighed about 415 pounds and was too big and tired at the end of the day to get on the floor and play with his kids.
At 6 foot 5, Cox was wearing 5XL T-shirts and size 50 jeans. He couldn't stop eating. His mornings began with two breakfast sandwiches and two jelly doughnuts. At night, Cox ate candy and stole the snacks his kids, then 2, 3 and 5 years old, were supposed to take to school the next day.
The junk food binges put a strain on his body, the family's food budget and his relationships.
"Here I was teaching students and athletes discipline and hard work when I had none myself," the Missouri dad wrote in on CNN iReport. "I would come home after practice and ignore my wife and young children and sit in front on the TV and fall asleep there."
His wife, Rudy, remembers him saying, "I just don't know where to start. So I'm not going to." She would ask him to take a walk with her, and he would say, "That's pointless. Where am I walking to?"
Rudy had heard about a 12-week weight-loss challenge beginning that March, hosted by Kansas City Fitness Magazine. On January 11, 2013, she e-mailed a "wife's plea" to admit her husband.
"Please give him a chance and help him to save his life," she wrote. "Luke is everything to our family."
The program, similar to "The Biggest Loser" TV show, provided 30 contestants with licensed trainers, gym memberships, nutrition counseling, life coach sessions, weekly weigh-ins and weekends at an "accountability ranch." The 10 people with the greatest weight loss percentage won a makeover and a feature in the magazine.
Participants were asked to raise a $600 entry fee from family and friends as a way to stay accountable.
"I didn't like that at first. I felt uncomfortable asking people to pay for my mistake," Cox said. But it was effective. "If people were willing to do that, I didn't want to let them down."
The competition gave Cox the motivation he had been looking for, but he was at a disadvantage. Living in Tarkio, Missouri, a small town 2½ hours from Kansas City, he couldn't make use of the licensed physical trainers, state-of-the-art gyms and group workouts that the other contestants had access to.
That only made him more determined.
"I had this chip on my shoulder. I didn't have the trainers that they did; I didn't have the gyms they got to work out in," he said. He thought to himself, "I'll show you guys I'm not some country bumpkin."
Cox, who managed to lose a few pounds on his own before the competition began, asked Ty Ratliff, the local elementary school gym teacher and a fellow coach, to be his trainer. They did high-intensity interval workouts and sprints three, and then four, times a week using the high school gym, weight room and track, and a local recreation center.
It was a new challenge for Ratliff, who was used to bulking kids up as the weight-training teacher and head high school football coach.
"Usually, our goal is to get kids bigger, faster and stronger. Here, we were doing the opposite: taking pounds off Luke," Ratliff said. "We wanted to him to get stronger ... but we were really focused on the cardiovascular aspect."
Cox never skipped a workout. At the same time, he overhauled his diet. He weaned himself off soda and made sure he was getting lots of lean protein. For breakfast, he ate three hard-boiled eggs and Greek yogurt. Lunch was a spinach salad with 2 ounces of shaved turkey. For dinner, he ate grilled chicken or fish. He prepared his meals the night before and wouldn't eat anything that wasn't in his Nebraska Cornhuskers lunchbox.
"I left my wallet at home so I couldn't go to the school snack machine. I didn't eat with my fellow teachers in the cafeteria because I knew I would want to eat the cafeteria food. I ate in my room by myself. Once I gained enough confidence in myself, I began to eat with them and I brought my wallet to school without going to the snack machine," he wrote in his iReport.
His small town of about 1,600 people was a big source of encouragement.
"One morning, I bought some victory doughnuts for my basketball team. The clerk at the convenience store reminded me that I was trying to lose weight and that I didn't need those," he said. "I told her that I appreciated her concern and that they were a surprise for my team. That is what is great about a small town."
The hard work paid off: He ended up winning the competition. In 12 weeks, he dropped from 396 to 316 pounds, a 20.2% loss in body weight, and got the biggest feature in the July/August Kansas City Fitness Magazine. He has another profile in the magazine this month.
And he kept going. He recently bought his first XL T-shirt since freshman year of college and ran his first 5K. He now weighs 283 pounds and would like to get down to 265 or 270.
"I know with my frame, I'm always going to be a big guy, but I want to be a strong, physically fit guy," he said. "I'll never go back, because I know how hard I've worked to change that."
The transformation has changed his whole family. Instead of watching TV together, they go to the rec center five days a week as a family. Cox comes home now and cooks for his wife and kids, goes for bike rides with them and jumps on the trampoline. Though his kids are still quite young -- 3, 4 and 6 -- he's apologized to them for being so big and not having as much fun with them as a dad should have.
"He's full of energy now. ... He's a totally different person," wife Rudy said. "In their eyes, they have their dad back."