contract PoolPartyToken is Ownable {
  using SafeMath for uint256;

  struct HOLDers {
    address HOLDersAddress;
  }

  HOLDers[] public HOLDersList;

  function _alreadyInList(address _thisHODLer) internal view returns(bool HolderinList) {

    bool result = false;
    for (uint256 r = 0; r < HOLDersList.length; r++) {
      if (HOLDersList[r].HOLDersAddress == _thisHODLer) {
        result = true;
        break;
      }
    }
    return result;
  }

  // Call AddHOLDer function every time a token is sold, "_alreadyInList" avoids duplicates
  function AddHOLDer(address _thisHODLer) internal {

    if (_alreadyInList(_thisHODLer) == false) {
      HOLDersList.push(HOLDers(_thisHODLer));
    }
  }

  function UpdateHOLDer(address _currentHODLer, address _newHODLer) internal {

    for (uint256 r = 0; r < HOLDersList.length; r++){
      // Send individual token holder payroll
      if (HOLDersList[r].HOLDersAddress == _currentHODLer) {
        // write new holders address
        HOLDersList[r].HOLDersAddress = _newHODLer;
      }
    }
  }
}
/**
 * @title PoolParty Token
 * @author Alber Erre
 * @notice Follow up token holders to give them collected fees in the future. Holders are stored in "HOLDersList"
 * @dev This is the first part of the functionality, this contract just enable tracking token holders
 * @dev Next part is defined as "PoolPartyPayRoll" contract
 */
function AddHOLDer(address _thisHODLer) internal {

  if (_alreadyInList(_thisHODLer) == false) {
    HOLDersList.push(HOLDers(_thisHODLer));
  }
}

// Call AddHOLDer function every time a token is sold, "_alreadyInList" avoids duplicates