Source: https://money.stackexchange.com/questions/37018/tax-consequences-of-partially-selling-a-stock