implement suggestion #199

Tentative pull. functional, with doc and test.