Improved compile.py file