Js reactions

Try to merge changes that fix computation of ractions
Better describe distinction between the two prepare matrix methods.