added post_compensation function