cluster sorting algorithm | ScratchStats