fixed a few bugs so that compiling and running works