int CountCells() { var visited = new HashSet<object> (); return CountCellsImpl (this.stack.GetUsedStack (), visited) + CountCellsImpl (this.currentEnvironment, visited); }