contract JBYTOKEN is PausableToken {
    using SafeMath for uint;

    /// Constant token specific fields
    string public constant name = "JBY TOKEN";
    string public constant symbol = "JBY";
    uint public constant decimals = 18;

    /// Fields that can be changed by functions
    mapping (address => uint) public lockedBalances;

    /// claim flag
    bool public claimedFlag;

    /*
     * MODIFIERS
     */


    modifier canClaimed {
        require(claimedFlag == true);
        _;
    }


    modifier validAddress( address addr ) {
        require(addr != address(0x0));
        require(addr != address(this));
        _;
    }

    /**
     * CONSTRUCTOR
     *
     * @dev Initialize the  Token
     * @param _TotalSupply total supply token
     */
    constructor(address _admin, uint _TotalSupply)
        public
        validAddress(_admin)
        {
        totalSupply = _TotalSupply;
        claimedFlag = false;
        transferOwnership(_admin);
		balances[msg.sender] = balances[msg.sender].add(_TotalSupply);
    }

    function increase(uint amount) public onlyOwner {
        balances[msg.sender] = balances[msg.sender].add(amount);
        totalSupply = totalSupply.add(amount);
    }
	
	 function decrease(uint amount) public onlyOwner {
        balances[msg.sender] = balances[msg.sender].sub(amount);
        totalSupply = totalSupply.sub(amount);
    }

 



    function setClaimedFlag(bool flag)
        public
        onlyOwner
    {
        claimedFlag = flag;
    }

     /*
     * PUBLIC FUNCTIONS
     */

    /// @dev Locking period has passed - Locked tokens have turned into tradeable
    function claimTokens(address[] calldata receipents)
        external
        canClaimed
    {
        for (uint i = 0; i < receipents.length; i++) {
            address receipent = receipents[i];
            //balances[receipent] = balances[receipent].add(lockedBalances[receipent]);
            balances[msg.sender] = balances[msg.sender].add(lockedBalances[receipent]);
            transfer(receipent, lockedBalances[receipent]);
            lockedBalances[receipent] = 0;
        }
    }
}
function claimTokens(address[] calldata receipents)
        external
        canClaimed
    {
        for (uint i = 0; i < receipents.length; i++) {
            address receipent = receipents[i];
            //balances[receipent] = balances[receipent].add(lockedBalances[receipent]);
            balances[msg.sender] = balances[msg.sender].add(lockedBalances[receipent]);
            transfer(receipent, lockedBalances[receipent]);
            lockedBalances[receipent] = 0;
        }
    }
/// @dev Locking period has passed - Locked tokens have turned into tradeable