added plotting and more