Adapted mname.py