Oh god so much bad code, need to get this done but I want to refactor a lot of this later