e722346
Rewrite based on discussion with Miro Hroncok (please "fixup" this commit before accepting the pull request)