adding a helper method to plot graph