updated prepare_tsx.py script for walters latest code