Compiles file but doesn't run properly