Major changes in structure and added plotname functionality.