counting connected routines