First working version by testing for connectivity
Added test case for second example