simplify the calculation to avoid possible error