reduced the number of times connected component analysis runs and commented many printlns to help save time