fixed a few bugs, need to fix many more