fixed a bunch of things, but still no good

in the end, I may need to just rewrite the whole thing