tweaks to regression code