Third round of cleaned up code.