fix share calculation algorithm