MakeAr.py: implement whole base program