refactored a bunch, tested nothing
tested seems to work
wow such refactor