tweak density calculation