Added functions for per node calculus.
Simple refactor for general and per node calculus sharing code