Patch 1 amended

Some additions to your PR, embodying my earlier remarks.  Untested.

Thanks to helix84 showed me how to set up my local repository properly to send you a pull request.