Added plot function