function m = kadd(m, to, param, stoich)
% 
% This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative 
% Works 3.0 United States License. To view a copy of this license, visit 
% http://creativecommons.org/licenses/by-nc-nd/3.0/us/ or send a letter to Creative Commons,
% 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
    assert(nargout == 1, 'kronecker:modelerror', 'function must be called with 1 output argument');
    assertBetween(to,   1, m.nX,  'kronecker:modelerror', 'Reactant #%d is out of range',      to);
    assertBetween(param, 1, m.nP, 'kronecker:modelerror', 'Parameter #%d is out of range',  param);
    assert(any(stoich == [-2, -1, 1, 2]), 'kronecker:modelerror', ...
        'Stoichiometric cooefecent is %d but must be +- 1,2', stoich);
    
    
    m.kP((param-1)*m.nX + to, 1) =  m.kP((param-1)*m.nX + to, 1) + stoich;
    m.k (to, 1)                  =  m.k(to, 1) + m.p(param) * stoich;
end