refactored a bit of sweepplayer