Mostly have new IRcode working

Have a few bugs to fix