new plot function and updated TOC function