Jayson Werth (28) is 6 for 7 since moving to the sixth spot in the Nationals lineup. (Alex Brandon/Associated Press)

There may be a method to Davey Johnson’s madness, after all.

With his team displaying agonizing offensive futility over the past month, Johnson switched Ian Desmond and Jayson Werth in the batting order (Desmond from sixth to second, Werth from second to sixth). Johnson, who said he the scoring struggles were driving him “to the looney bin,” suggested the decision was made on a late-night, “why not?” whim, not so much calculated as necessitated by process of elimination.

Calculated or not, Johnson’s switch has paid off. Werth is 6 for 7 with a walk and three runs scored in two games in the six spot. The shift hasn’t slowed Desmond, either: after hitting .306 with nine homers from the sixth spot in June, he’s 4 for 7 with two walks in the two games in the two hole.

Small sample size, you say? True, but consider this: In 98 at-bats in the second slot in 2013, Werth is hitting just .224 with 22 hits. In seven at-bats in the six hole, he has six hits and three runs scored.

“I think [Werth] likes the fact that at five or six [in the lineup], there’s generally going to be a lot of guys on,” Johnson said. “He’s more aggressive when he’s in that spot, and I like that about him.”

Johnson said before Friday’s game he plans to stick with the lineup change as long as it’s working. After Desmond and Werth combined to go 4 for 8 with two runs scored and an RBI — not to mention propelling an eight-run outburst — Johnson will probably be penciling Desmond in second and Werth sixth for the foreseeable future.