Cleaned up code in sweep, for importing
Shortened filename to sweep.py