Use arrays for better sorting of cluster

Signed-off-by: Vlad <vg@vladgh.com>