fixed a bunch of bugs
fixed a couple more bugs