Code Clean Up 1

Cleaned up the code somewhat. Note: all code fails are located in the
branches. The main branch *should* only include working code.