modified the mai.py