a whole lot of changes—pulling over from old version