Calculating Capital Gain