backward_difference_code function

Use backward difference coding