Added plotting and some more functions for plotting