new plot scan function