Better calculation of ratio