Trying to automate the plotting process, my code is messy! needs cleaning.