fixed enough that it runs. Debugging past me's code as though inheriting shitty code from somewhere else