Final commit: I realized that this program is fundamentally flawed.
Beginning rewrite from scratch.