Cleaned up the code a bit to remove unnecessary plots.