Implemented calculation of Density of States.