Some cleanup, split up algorithm for easier debugging
Remove disclaimer