hdi.density method added