Working on simulation of the algorithm.
Wrote all the equilibrium equations.