Modified find_max_qos_ratio.py