Cleans up the Peterson Leader Election algorithm.