in the middle of implementing connected components