improved plotter.py