Highest Density Regions (HDR) misunderstanding

The code above is truncated. The original is gone.