Added cephdon's latest pipe code, and modified ExecuteFunction to return a value