hackily fixed a bunch of stuff