put getting the equation terms at separate function