function totalSupplyAt(uint256 _blockNumber) public view returns(uint256) {

    
    
    
    
    
    if ((totalSupplyHistory.length == 0) || (totalSupplyHistory[0].fromBlock > _blockNumber)) {
      if (address(parentToken) != 0) {
        return parentToken.totalSupplyAt(Math.min256(_blockNumber, parentSnapShotBlock));
      } else {
        return 0;
      }
    
    } else {
      return getValueAt(totalSupplyHistory, _blockNumber);
    }
  }