did lots of refactoring, and added support for multiple plots appearing on the same graph.