function set_winner (uint prize, address waiting_prayer, bytes32 block_hash, uint god_block_number) private returns (uint){

        count_rounds_winner_logs[count_rounds] = add(count_rounds_winner_logs[count_rounds], 1);
        winner_logs[count_rounds][count_rounds_winner_logs[count_rounds]].god_block_number = god_block_number;
        winner_logs[count_rounds][count_rounds_winner_logs[count_rounds]].block_hash = block_hash;
        winner_logs[count_rounds][count_rounds_winner_logs[count_rounds]].prayer = waiting_prayer;
        winner_logs[count_rounds][count_rounds_winner_logs[count_rounds]].prize = prize;

        if (count_listed_winners[prize] >= max_winners[prize]){ 
           	uint pk_position = pk_positions[prize];
        	address previous_winner = listed_winners[prize][pk_position];  

            bool pk_result = pk(waiting_prayer, previous_winner, block_hash);

			winner_logs[count_rounds][count_rounds_winner_logs[count_rounds]].pk_result = pk_result;
			winner_logs[count_rounds][count_rounds_winner_logs[count_rounds]].previous_winner = previous_winner;
            
            if (pk_result == true) {
                listed_winners[prize][pk_position] = waiting_prayer; 
            }
            if (prize > 1) { 
                if (pk_positions[prize] > 1){
                    pk_positions[prize] = sub(pk_positions[prize], 1);
                } else {
                    pk_positions[prize] = max_winners[prize];
                }               
            }
        } else {
            count_listed_winners[prize] = add(count_listed_winners[prize], 1);
            listed_winners[prize][count_listed_winners[prize]] = waiting_prayer;
        }
     
        return count_listed_winners[prize];
    }