Fixed a bug where plot2 output to plot1. Made several cosmetic tweaks.