Implements density control.