Move code to empty_exact_cover

Isolated piece of code into empty_exact_cover.