beginning of moving Greg's code into the fold.