ultimate plotting code