function vote(uint proposalId, uint yeas, uint nays) public {

    require(
      proposals[proposalId].deadline > block.timestamp,
      "Voting closed"
    );
    if(proposals[proposalId].deadline > deposits[msg.sender].lockedUntil) {
      
      deposits[msg.sender].lockedUntil = proposals[proposalId].deadline;
    }
    
    proposals[proposalId].votes[msg.sender] = proposals[proposalId].votes[msg.sender].add(yeas).add(nays);
    require(proposals[proposalId].votes[msg.sender] <= deposits[msg.sender].balance, "Insufficient balance");

    
    proposals[proposalId].yeas = proposals[proposalId].yeas.add(yeas);
    proposals[proposalId].nays = proposals[proposalId].nays.add(nays);

    emit Vote(proposalId, msg.sender, yeas, nays, proposals[proposalId].yeas, proposals[proposalId].nays);
  }