fixed all compile-time errors and commented where it crashes