Made a proper life-cycle process for the engine, fixed some small things