Added wsweep function