finished the grouping script, it works and will group any number of connected components it does not track across time