Added real time plotting to the file