Major changes in structure and added plotname functionality.
Minor math changes.