extended ruby script with density and area data. Fixed NaN value in area calculation