@qmx Tweaked and rebased.