writing draft for engine code with one side effect