added support for 40 or more parameters and calculated parameters.  changed one instance of execute to call_function, which should speed things up.