update Reducer alghoritm