Connected components algorithm implemented, works