local density calculation is fixed