Added data structure for recursion handling