Changes to support yield, based on almost\'s work