function __callback(bytes32 _queryId, string _result, bytes _proof) onlyOraclizeOr(getContract('FD.Emergency')) public {

        var (policyId,) = FD_DB.getOraclizeCallback(_queryId);
        LogOraclizeCallback(policyId, _queryId, _result, _proof);

        var slResult = _result.toSlice();

        
        
        
        if (bytes(_result).length == 0) {
            decline(policyId, "Declined (empty result)", _proof);
        } else {
            
            
            if (slResult.count(", ".toSlice()) != 7) {
                
                decline(policyId, "Declined (invalid result)", _proof);
            } else {
                slResult.beyond("[".toSlice()).until("]".toSlice());

                uint observations = parseInt(slResult.split(", ".toSlice()).toString());

                
                
                if (observations <= MIN_OBSERVATIONS) {
                    decline(policyId, "Declined (too few observations)", _proof);
                } else {
                    uint[6] memory statistics;
                    
                    statistics[0] = observations;
                    for (uint i = 1; i <= 5; i++) {
                        statistics[i] = parseInt(slResult.split(", ".toSlice()).toString()) * 10000/observations;
                    }

                    var origin = slResult.split(", ".toSlice());
                    for (uint j = 0; j < FD_DB.countOrigins(); j++) {
                        if (b32toString(FD_DB.getOriginByIndex(j)).toSlice().equals(origin)) {
                            underwrite(policyId, statistics, _proof);
                            return;
                        }
                    }

                    var destination = slResult.split(", ".toSlice());
                    for (uint k = 0; k < FD_DB.countDestinations(); k++) {
                        if (b32toString(FD_DB.getDestinationByIndex(k)).toSlice().equals(destination)) {
                           underwrite(policyId, statistics, _proof);
                           return;
                        }
                    }

                    decline(policyId, "Not acceptable airport", _proof);
                }
            }
        }
    }