Determining Capital Gain and Tax Bill