changing iDensity to conditional fixes init. problems