change compile.py
introduce fields.py and a shared variables approach