changed new and engine code