working on this again.
code cleanup.