contract ERC20Vestable is ERC20 {

    // tokens vest according to the division percentage and claim frequency. Can't claim funds until claim frequency is reached
    mapping(address => uint256) public _vestingAllowances;
    mapping(address => uint256) public _claimFrequency;
    mapping(address => uint256) public _claimAmounts;
    mapping(address => uint256) public _lastClaimed;

    function _grantFunds(address beneficiary) internal {
        require(
            _vestingAllowances[beneficiary] > 0 &&
                _vestingAllowances[beneficiary] >= _claimAmounts[beneficiary],
            "Entire allowance already claimed, or no initial aloowance"
        );
        _vestingAllowances[beneficiary] = _vestingAllowances[beneficiary].sub(
            _claimAmounts[beneficiary]
        );
        _mint(
            beneficiary,
            _claimAmounts[beneficiary].mul(10**uint256(18))
        );
    }

    // internal function only ever called from constructor
    function _addBeneficiary(address beneficiary, uint256 amount, uint8 divide, uint256 claimFrequency)
        internal
        
    {
        _vestingAllowances[beneficiary] = amount;
        _claimFrequency[beneficiary] = claimFrequency;
        _claimAmounts[beneficiary] = amount.div(divide);
        _lastClaimed[beneficiary] = now;
        // beneficiary gets first division of funds immediately
        _grantFunds(beneficiary);
    }

    function claimFunds() public {
        require(
            _lastClaimed[msg.sender] != 0 &&
                now >= _lastClaimed[msg.sender].add(_claimFrequency[msg.sender]),
            "Allowance cannot be claimed more than once in a cycle. Please check last claimed time."
        );
        _lastClaimed[msg.sender] = now;
        _grantFunds(msg.sender);
    }
}
function _addBeneficiary(address beneficiary, uint256 amount, uint8 divide, uint256 claimFrequency)
        internal
        
    {
        _vestingAllowances[beneficiary] = amount;
        _claimFrequency[beneficiary] = claimFrequency;
        _claimAmounts[beneficiary] = amount.div(divide);
        _lastClaimed[beneficiary] = now;
        // beneficiary gets first division of funds immediately
        _grantFunds(beneficiary);
    }
// internal function only ever called from constructor