implement suggestion #199

Tentative pull. functional, with doc and test.
It's hard to read with this else clause not indented the same amount as the line with "if ... then" on it.