Final version

tests, sweeper and more