tweaks to make gary's changes work. (Bad merge)