trying to add sorting of clusters and json output and stuff