I scripted the following recursion function to calculate all of the possible paths from a target node to a start node in a graph using adjacency matrix.

```
private Stack<string> TestCaseGeneration(int TargetStateIndex, double[,] adjacancy, Stack<string> TotalResults = null, Stack<string> CarrierStack = null, int StartStateIndex = 0)
{
    Stack<string> Result = CarrierStack;
    Result.Push(TargetStateIndex.ToString() + " - ");

    if (TargetStateIndex == StartStateIndex)
    {
       TotalResults.Push(StackToSingleString(Result));
       return TotalResults;
    }
    else
    {
       List<string> neighbours = ListNeighbourLeadingToTargetNode(TargetStateIndex, adjacancy, EventIndex);
       int NumberOfNeighbours = neighbours.Count;
       if (NumberOfNeighbours != 0)
       {
           for (int i = 0; i < NumberOfNeighbours; i++)
           {
              return TestCaseGeneration(int.Parse(neighbours[i].ToString()), adjacancy, TotalResults, Result, StartStateIndex);
           }
        }
     }
     else return null;
  }

```

The issue is `return` int the `for` loop, how can I fix it?