uses density constant instead of hardcoded values, ref #185