Added saving data in file for visualization