refactored the parser
added missing import
rectored tir.py