1st version of plot generating functions