Fixed error in calculating r_ua,max...again.