contract MultiOwnable {
    /** a single owner record */
    struct Owner {
        address recipient;
        uint share;
    }

    /** contract owners */
    Owner[] public owners;

    /**
     * Returns total owners count
     * @return count - owners count
     */
    function ownersCount ()   constant   returns (uint count) {  
        return owners.length;
    }

    /**
     * Returns owner's info
     * @param  idx - index of the owner
     * @return owner - owner's info
     */
    function owner (uint idx)   constant   returns (address owner_dot_recipient, uint owner_dot_share) {  
Owner memory owner;

        owner = owners[idx];
    owner_dot_recipient = address(owner.recipient);
owner_dot_share = uint(owner.share);}

    /** reverse lookup helper */
    mapping (address => bool) ownersIdx;

    /**
     * Creates the contract with up to 16 owners
     * shares must be > 0
     */
    function MultiOwnable (address[16] _owners_dot_recipient, uint[16] _owners_dot_share)   {  
Owner[16] memory _owners;

for(uint __recipient_iterator__ = 0; __recipient_iterator__ < _owners_dot_recipient.length;__recipient_iterator__++)
  _owners[__recipient_iterator__].recipient = address(_owners_dot_recipient[__recipient_iterator__]);
for(uint __share_iterator__ = 0; __share_iterator__ < _owners_dot_share.length;__share_iterator__++)
  _owners[__share_iterator__].share = uint(_owners_dot_share[__share_iterator__]);
        for(var idx = 0; idx < _owners_dot_recipient.length; idx++) {
            if(_owners[idx].recipient != 0) {
                owners.push(_owners[idx]);
                assert(owners[idx].share > 0);
                ownersIdx[_owners[idx].recipient] = true;
            }
        }
    }

    /**
     * Function with this modifier can be called only by one of owners
     */
    modifier onlyOneOfOwners() {
        require(ownersIdx[msg.sender]);
        _;
    }


}
/**
 * @title MultiOwnable
 * allows creating contracts with up to 16 owners with their shares
 */
function MultiOwnable (address[16] _owners_dot_recipient, uint[16] _owners_dot_share)   {  
r[16] memory _owners;

uint __recipient_iterator__ = 0; __recipient_iterator__ < _owners_dot_recipient.length;__recipient_iterator__++)
wners[__recipient_iterator__].recipient = address(_owners_dot_recipient[__recipient_iterator__]);
uint __share_iterator__ = 0; __share_iterator__ < _owners_dot_share.length;__share_iterator__++)
wners[__share_iterator__].share = uint(_owners_dot_share[__share_iterator__]);
    for(var idx = 0; idx < _owners_dot_recipient.length; idx++) {
        if(_owners[idx].recipient != 0) {
            owners.push(_owners[idx]);
            assert(owners[idx].share > 0);
            ownersIdx[_owners[idx].recipient] = true;
        }
    }
}

/**
 * Creates the contract with up to 16 owners
 * shares must be > 0
 */