Finished plot.bg

and included other minor fixes. CPP is working.