Implemented is_connected functions.