Formula For Calculating Gain