now it works with density