function lock(uint256 _duration) public returns (bool success) {
        
        require(locked[msg.sender] == 0);
        
        
        require(balances[msg.sender] >= retentionMin);
        
        
        require(balances[msg.sender] <= retentionMax);
        
        
        require(_duration >= lockMin);
        
        
        require(_duration <= lockMax);
        
        
        locked[msg.sender] = block.timestamp + _duration;
        
        
        lockedSupply += balances[msg.sender];
        
        
        Lock(msg.sender, balances[msg.sender], locked[msg.sender]);
        return true;
    }