first version of plot graph