fixed a lot of things. can't test when I'm at work ;_;

it seems to work.