function setupVote(uint motionID)
        internal
        returns (uint)
    {
        
        
        require(motionVoting(motionID));

        
        require(!hasVoted(msg.sender, motionID));

        
        require(msg.sender != motionTarget[motionID]);

        
        havven.recomputeAccountLastAverageBalance(msg.sender);

        uint weight;
        
        
        
        if (motionStartTime[motionID] < havven.feePeriodStartTime()) {
            weight = havven.penultimateAverageBalance(msg.sender);
        } else {
            weight = havven.lastAverageBalance(msg.sender);
        }

        
        require(weight > 0);

        voteWeight[msg.sender][motionID] = weight;

        return weight;
    }