massive changes

many of these changes are not general...