changes to directory set up and to plotting subfunctions