Added plotting function