started plot function