revise the calculation part density