debugged third_mqr.pl