It works, that was easy
refactored for clarity
Initial solution, needs refactoring
removed meh types, refactored to be clearer