TASK: code cleanup
--started work on better organizing the code
--it's incomplete so don't try to run this, it will not run