connected components stuff added