Calculating gains and division of gains