compiles and runs, though weird stuff happens