correctly calculate communication costs