Bugfix in calculating the average value.
Better graph drawing.