added sweeping function and finished other magnet stuff - chase