Changed density condition checker from int to float