A method of operating a four stoke internal combustion piston engine comprising a) forming a charge into a combustion chamber of a cylinder of the engine comprising steps of: removing exhaust gas from the combustion chamber during movement of a piston towards the next top dead center position of the piston by controllably opening, and closing an exhaust valve of the cylinder so that a predetermined amount of exhaust gas from combustion of previous charge, is left in the combustion chamber, and introducing lower reactivity fuel into the intake air during a subsequent intake stroke of the piston and introducing the lower reactivity fuel and the intake air into the combustion chamber of a cylinder of the engine during the intake stroke via an inlet valve, and introducing a controlled amount of higher reactivity fuel into the combustion chamber of the cylinder, b) compressing the charge in the combustion chamber and igniting the charge by compression ignition in the combustion chamber thus forming exhaust gas, c) determining a lambda data for the combustion of the charge, and d) controlling the closing timing of the exhaust gas valve of the cylinder by making use of the lambda data characterized in that controlling the cylinder-wise closing timing of the exhaust valve comprises A. measuring the lambda data in which value of concentration of oxygen in the exhaust gas, collectively for all cylinders of the engine is measured, providing a base level for the lambda data, and B. determining a cylinder specific estimated value for the indicative concentration of oxygen based on cylinder specific input values providing a cylinder-wise adjustment to the lambda data obtained in the step A, and further C. determining a first control input data which is determined separately for each one of the cylinders (10.1... 10.N) of the engine using injection amount of higher reactivity fuel for the cylinder, thus providing a cylinder-wise control of closing timing of the exhaust valve. a) forming a charge into a combustion chamber of a cylinder of the engine comprising steps of: removing exhaust gas from the combustion chamber during movement of a piston towards the next top dead center position of the piston by controllably opening, and closing an exhaust valve of the cylinder so that a predetermined amount of exhaust gas from combustion of previous charge, is left in the combustion chamber, and introducing lower reactivity fuel into the intake air during a subsequent intake stroke of the piston and introducing the lower reactivity fuel and the intake air into the combustion chamber of a cylinder of the engine during the intake stroke via an inlet valve, and introducing a controlled amount of higher reactivity fuel into the combustion chamber of the cylinder, removing exhaust gas from the combustion chamber during movement of a piston towards the next top dead center position of the piston by controllably opening, and closing an exhaust valve of the cylinder so that a predetermined amount of exhaust gas from combustion of previous charge, is left in the combustion chamber, and introducing lower reactivity fuel into the intake air during a subsequent intake stroke of the piston and introducing the lower reactivity fuel and the intake air into the combustion chamber of a cylinder of the engine during the intake stroke via an inlet valve, and introducing a controlled amount of higher reactivity fuel into the combustion chamber of the cylinder, b) compressing the charge in the combustion chamber and igniting the charge by compression ignition in the combustion chamber thus forming exhaust gas, c) determining a lambda data for the combustion of the charge, and d) controlling the closing timing of the exhaust gas valve of the cylinder by making use of the lambda data A. measuring the lambda data in which value of concentration of oxygen in the exhaust gas, collectively for all cylinders of the engine is measured, providing a base level for the lambda data, and B. determining a cylinder specific estimated value for the indicative concentration of oxygen based on cylinder specific input values providing a cylinder-wise adjustment to the lambda data obtained in the step A, and further C. determining a first control input data which is determined separately for each one of the cylinders (10.1... 10.N) of the engine using injection amount of higher reactivity fuel for the cylinder, thus