Add cluster and annealment logic

completely untested