updated equations in code and doc