minor tweaks, based on work from another branch