Minor revision on plot function