Changed the cluster code to include distance criterion along with residual criterion for testing if an ROI is new