updated max_diff