code compiles in new structure. still need cleanups.