Fixed a bug in the code that recalibrates the graphs