Double-sweep implementation and test