First pass is kinda working
Refactored code. Making good progress