function withdraw() external onlyWhenClosed {
        require (entrants[msg.sender].sender != 0x0, 'Current user has not entered');
        require (entrants[msg.sender].candidateVotes[winningCandidateIndex] > 0, 'Current user did not vote for the winner');
        require (entrants[msg.sender].paid == false, 'User has already been paid');
        require (now < SafeMath.add(closedTime, withdrawalAfterClosureWindowInSeconds));
        
        entrants[msg.sender].paid = true;

        uint totalWinnings = SafeMath.mul(winningsPerVote, entrants[msg.sender].candidateVotes[winningCandidateIndex]);

        msg.sender.transfer(totalWinnings);
    }