leg.py has local instead of global variables