made a few small changes mostly to Engine.cs