fixed a bunch of basic errors