fixed bugs in computeShares