This is for #37 (closed). It turned out to be simpler than expected.
I did test it, but further testing never hurts.