slight refactoring to assume all IRs are same length. checking in untested, incomplete example file (can't build it yet)