How to use "puzzling" in a sentence

Sentences

He would most likely die on the stage, in the middle of puzzling out a tricky production problem.