Fixed a small bug at the end of the function w/ ggsave().  Reorganized the code a bit.