weakly connected component working and tests implemented