contract Whitelist is StandardToken {
    mapping(address => bool) whitelist;
    event AddedToWhitelist(address indexed account);
    event AddedToWhitelistBulk(address indexed account);
    event RemovedFromWhitelist(address indexed account);

    modifier onlyWhitelisted() {
        require(isWhitelisted(_msgSender()), "This address is not whitelisted");
        _;
    }
    // For multiple addresses to be added in the whitelist
    function addToWhitelistInBulk(address[] memory _address) public onlyOwner {
        for (uint8 loop = 0; loop < _address.length; loop++) {
            whitelist[_address[loop]] = true;
        }
    }
    // For single address to be added in whitelist
    function removeFromWhitelistSingle(address _address) public onlyOwner {
        whitelist[_address] = false;
        emit RemovedFromWhitelist(_address);
    }
    // For multiple addresses to be removed from the whitelist
    function removeFromWhitelistInBulk(address[] memory _address) public onlyOwner {
        for (uint8 loop = 0; loop < _address.length; loop++) {
            whitelist[_address[loop]] = false;
        }

    }
    // Check whether an address is whitelisted or not
    function isWhitelisted(address _address) public view returns(bool) {
        return whitelist[_address];
    }

}
function isWhitelisted(address _address) public view returns(bool) {
    return whitelist[_address];
}

// Check whether an address is whitelisted or not