Added some functions for plotting