second update of is_connected.py