Adjusted makeatm.py to work properly with TEA