Nearly finished with implementating computeDensity.