added plot function for example