Code to allow running clustering multiple times since right now this seems needed. The clustering flag is now an integer. Tagging @wollrath so he can play with this, @brosser so he knows, @lipeles because this may be a bigger effect for inside-out algorithm and @imaznas so he knows.