Cleaned up code in first phase.  Answer is right perf is still off.