Rehaul complete. Code actually functional.