function pray () public returns (bool){
        require (add(gods[msg.sender].block_number, min_pray_interval) < block.number
        && tx.gasprice <= max_gas_price
        && check_event_completed() == false);

        if (waiting_prayer_index <= count_waiting_prayers) {

            address waiting_prayer = waiting_prayers[waiting_prayer_index];
            uint god_block_number = gods[waiting_prayer].block_number;
            bytes32 block_hash;
            
            if ((add(god_block_number, 1)) < block.number) {

                if (add(god_block_number, block_hash_duration) < block.number) {
                    gods[waiting_prayer].block_number = block.number; 
                    
                    count_waiting_prayers = add(count_waiting_prayers, 1);
                    waiting_prayers[count_waiting_prayers] = waiting_prayer;
                } else {
                    block_hash = keccak256(abi.encodePacked(blockhash(add(god_block_number, 1))));
                    if(gods[waiting_prayer].gene_created == false){
                        gods[waiting_prayer].gene = block_hash;
                        gods[waiting_prayer].gene_created = true;
                    }
                    gods[waiting_prayer].pray_hash = block_hash;
    
                    uint dice_result = eth_gods_dice.throw_dice (block_hash)[0];

                    if (dice_result >= 1 && dice_result <= 5){
                        set_winner(dice_result, waiting_prayer, block_hash, god_block_number);
                    }
                }
                waiting_prayer_index = add(waiting_prayer_index, 1);
            }
        }
        
        count_waiting_prayers = add(count_waiting_prayers, 1);
        waiting_prayers[count_waiting_prayers] = msg.sender;

        gods[msg.sender].block_number = block.number;
        add_exp(msg.sender, 1);
        add_exp(pray_host_god, 1);

        return true;
    }