Refactored some code

Made the plots into subplots, and took some suggestions from Reddit user
mercurysinking