WORKS EXCEPT FOR COMPLEXITY

Reducing complexity in main after this.  Revert if necessary