What would you do if you were diagnosed with stage 4 cancer and given only a few months to live? For 57-year-old Minnesotan Greg Thomas, that blow came right on the heels of losing his job.

Rather than give in to despair, Thomas found a new mission to devote the remainder of his life to. After stumbling upon an abandoned church in rural Minnesota, Thomas decided to commit his final days to restoring it.

While going through several rounds of chemo and relying on a feeding tube for nutrition, Thomas spent his days working to restore the church to its former glory.

The church was built in 1868 but had been sitting empty for nearly a century. Thomas found it to be a place of solace and set to work at breathing new life into the building.

Even as cancer and cancer treatments robbed him of his energy, he spent his days repainting the church and working to fix other signs of wear and aging inside.

In a twist that doesn’t surprise those who believe in the power of prayer, Thomas was met with a miracle when his cancer went into remission in 2012.

Despite the church’s refound glory and the miraculous extension to the life of the man who restored it, this story has taken a sad turn. His cancer returned in 2016, without any good treatment options available.

In his final days, he is hoping to become a pastor and preach in the church he so faithfully restored.