LOTS of refactoring.  Compiles without errors/warnings, but doesn't work.  Need to use kill -9 on the process to kill it