added 2D scanning fxn