added complete example for performing compensation