Implementing class Density: Not yet tested. Added getValue() to class Contracted.