fis a few bugs and add irgw.py.