removed the plot writing functions from the script