updating simplifies, moved CalcTerm to its own file