This function takes the following parameters:
Upon input, contains the index from which the search for the next backend is done. Upon output, contains the index of the returned backend.