Changed plotting function