Finished plot function