Switched to using GraphSubset and using a stack for variable storage