worked mainly on engine.cs