optimisation for merging clusters