sum_code function

Use sum coding