completely restructured version.