Updated to use delegates for the Run method.