updated the ExecFunction method to be able to return results as well.