fixed a few bugs and stuff