Wrote half of the swendsen wang code