How Capital Gains Tax Is Calculated