Initial rework - code has no effect for some reason.
Minor mods