We add the pwl computation function