incomplete version

need to check is graph is connected